Frappe Syntax Doctypes logo

Frappe Syntax Doctypes

Organization
Impertio-Studio
frappe-syntax-doctypes

Use when creating or modifying DocType JSON definitions, choosing fieldtypes, configuring naming rules, adding child tables, or setting up tree structures. Prevents invalid DocType configurations from wrong fieldtype choices, broken naming rules, and misconfigured child table links. Covers DocType JSON schema, all fieldtypes and their properties, autoname/naming_rule patterns, child table (Table fieldtype), tree DocTypes, virtual DocTypes, Single DocTypes. Keywords: DocType, fieldtype, naming_rule, autoname, child table, tree, virtual DocType, Single, JSON definition, Custom Field, Customize Form, add field without code, hierarchy, tree view, field types list..

Overview

PublisherImpertio-Studio
RepositoryFrappe_Claude_Skill_Package
Skill namefrappe-syntax-doctypes
Stars
180
Forks
53
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Impertio-Studio on GitHub. Read the source before you install it.

Installation

Install the Frappe Syntax Doctypes AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git /tmp/Frappe_Claude_Skill_Package
mkdir -p .claude/skills
cp -r /tmp/Frappe_Claude_Skill_Package/skills/source/syntax/frappe-syntax-doctypes .claude/skills/frappe-syntax-doctypes
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Frappe Syntax Doctypes in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Frappe Syntax Doctypes on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Frappe Syntax Doctypes is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DocType JSON Design

DocTypes are the foundation of every Frappe application. A DocType defines both the data model (database schema) and the view (form layout). ALWAYS design DocTypes before writing any controller logic.

Quick Reference

DocType JSON Top-Level Properties

PropertyTypePurpose
namestrDocType identifier (singular, e.g. "Sales Invoice")
modulestrApp module this DocType belongs to
is_submittableboolEnables Draft -> Submitted -> Cancelled workflow
is_treeboolEnables NestedSet hierarchy (lft/rgt columns)
is_virtualboolNo database table; data from custom backend
issingleboolSingle-instance settings document
istableboolChild table DocType (embedded in parent)
is_calendar_and_ganttboolEnables calendar/gantt views
track_changesboolStores version history on every save
track_seenboolTracks which users viewed the document
track_viewsboolCounts total document views
allow_renameboolPermits renaming after creation
allow_copyboolEnables "Duplicate" action
allow_importboolEnables Data Import for this DocType
naming_rulestrNaming method selector (see Naming section)
autonamestrNaming pattern string
title_fieldstrField used as display title
search_fieldsstrComma-separated fields for search results
show_title_field_in_linkboolDisplay title instead of name in Link fields
image_fieldstrField containing image for avatar display
sort_fieldstrDefault sort column
sort_orderstr"ASC" or "DESC"
default_print_formatstrPrint Format name
max_attachmentsintAttachment limit

Common Fieldtypes (Quick Lookup)

FieldtypeStoresDB Column
DataText up to 140 charsVARCHAR(140)
LinkReference to another DocTypeVARCHAR(140)
Dynamic LinkReference to any DocTypeVARCHAR(140)
SelectSingle choice from optionsVARCHAR(140)
TableChild table rowsSeparate table
Table MultiSelectMulti-select link rowsSeparate table
CheckBoolean 0/1TINYINT
IntWhole numberINT
FloatDecimal (9 places)DECIMAL
CurrencyMoney value (6 decimals)DECIMAL
DateCalendar dateDATE
DatetimeDate + timeDATETIME
Text EditorRich text (HTML)LONGTEXT
AttachFile referenceVARCHAR(140)
Small TextShort multi-line textTEXT
Long TextUnlimited textLONGTEXT

Full fieldtype reference with all 35+ types: references/fieldtypes.md

Essential Field Properties

PropertyTypePurpose
reqdboolField is mandatory
uniqueboolDatabase UNIQUE constraint
search_indexboolDatabase INDEX for faster queries
in_list_viewboolShow in list view columns
in_standard_filterboolShow as filter in list view
in_previewboolShow in document preview
allow_on_submitboolEditable after submission
read_onlyboolNot editable by user
hiddenboolNot visible on form
depends_onstrVisibility condition (e.g. eval:doc.status=="Active")
mandatory_depends_onstrConditional mandatory
read_only_depends_onstrConditional read-only
fetch_fromstrAuto-populate from linked doc (e.g. customer.customer_name)
fetch_if_emptyboolOnly fetch when field is empty
optionsstrFieldtype-specific (DocType name, select options, etc.)
defaultstrDefault value (supports __user, Today, etc.)
descriptionstrHelp text below field
collapsibleboolSection starts collapsed (Section Break only)

Decision Tree: Which DocType Type?

Need to store data?
├─ YES: Need multiple records?
│  ├─ YES: Need submit/cancel workflow?
│  │  ├─ YES → Standard DocType + is_submittable=1
│  │  └─ NO: Need hierarchy/tree?
│  │     ├─ YES → Tree DocType (is_tree=1)
│  │     └─ NO: Embedded in parent?
│  │        ├─ YES → Child DocType (istable=1)
│  │        └─ NO → Standard DocType
│  └─ NO: Single config/settings → Single DocType (issingle=1)
└─ NO: Data from external source → Virtual DocType (is_virtual=1)

Naming Rules

ALWAYS set naming_rule on the DocType. The autoname field holds the pattern.

naming_rule Valueautoname PatternExample Output
Set by User(empty)User types name manually
Autoincrement(empty)1, 2, 3
By Fieldnamefield:{fieldname}Value of that field
By Naming Seriesnaming_series:INV-2024-00001 (from series field)
ExpressionPRE-.#####PRE-00001, PRE-00002
Expression (Old Style){prefix}-{YYYY}-{#####}INV-2024-00001
RandomhashRandom 10-char string
UUID(empty)550e8400-e29b-...
By Script(custom)Controller autoname() decides

NEVER use Autoincrement in production -- gaps appear when records are deleted. Use Expression or Naming Series instead.

Full naming reference: references/naming.md

Child Table Design

A Child DocType is a DocType with istable=1. It ALWAYS belongs to a parent.

Parent side -- add a field with:

  • fieldtype: Table (or Table MultiSelect)
  • options: Child DocType name

Child records automatically get:

  • parent -- name of the parent document
  • parenttype -- DocType of the parent
  • parentfield -- fieldname of the Table field in parent
  • idx -- row order (1-based)
python
# Adding child rows programmatically
doc = frappe.get_doc("Sales Invoice", "INV-001")
doc.append("items", {
    "item_code": "ITEM-001",
    "qty": 5,
    "rate": 100.0
})
doc.save()

NEVER create a Child DocType without istable=1. NEVER reference a non-child DocType in a Table field.

Table vs Table MultiSelect

AspectTableTable MultiSelect
UIFull editable grid with "Add Row"Tag-style picker, no "Add Row"
Child DocTypeFull child with many fieldsTypically 1 Link field only
Use caseLine items, detail rowsMulti-select references

Single DocType (Settings Pattern)

Set issingle=1. Data is stored in tabSingles as key-value pairs, NOT in a dedicated table.

python
# Access Single DocType
settings = frappe.get_single("My Settings")
value = settings.some_field

# Or directly
value = frappe.db.get_single_value("My Settings", "some_field")
  • NEVER expect a list view for Single DocTypes -- they have exactly one instance.
  • ALWAYS use for app-wide configuration (API keys, default values, feature toggles).

Tree DocType (NestedSet)

Set is_tree=1. Frappe adds lft, rgt, parent_{doctype_fieldname}, old_parent columns automatically.

  • ALWAYS define a parent_field in the DocType JSON (e.g. parent_account for Chart of Accounts).
  • The NestedSet model uses lft/rgt integers for efficient subtree queries.
  • NEVER manually edit lft/rgt values. Use frappe.utils.nestedset.rebuild_tree() if corrupted.
python
# Get all descendants
descendants = frappe.get_all("Account",
    filters={"lft": [">", node.lft], "rgt": ["<", node.rgt]})

# Get ancestors (path to root)
ancestors = frappe.get_all("Account",
    filters={"lft": ["<", node.lft], "rgt": [">", node.rgt]},
    order_by="lft asc")

Virtual DocType

Set is_virtual=1. No database table is created. ALWAYS implement these controller methods:

python
class MyVirtualDoc(Document):
    def db_insert(self, *args, **kwargs):
        # Persist to your custom backend
        pass

    def load_from_db(self):
        # Load document data from your source
        pass

    def db_update(self, *args, **kwargs):
        # Update in your custom backend
        pass

    def delete(self):
        # Remove from your custom backend
        pass

    @staticmethod
    def get_list(args):
        # Return list of documents
        pass

    @staticmethod
    def get_count(args):
        # Return total count
        pass

    @staticmethod
    def get_stats(args):
        # Return statistics
        pass

NEVER use frappe.db.* calls for Virtual DocType data -- they only work with the site database, not your custom backend.

Customization APIs

Custom Fields (Programmatic)

python
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields

# Dict format: {DocType: [field_dicts]}
create_custom_fields({
    "Sales Invoice": [
        dict(fieldname="custom_tracking", label="Tracking ID",
             fieldtype="Data", insert_after="naming_series")
    ],
    "Purchase Order": [
        dict(fieldname="custom_vendor_ref", label="Vendor Ref",
             fieldtype="Data", insert_after="supplier")
    ]
}, update=True)

Property Setter (Programmatic)

python
from frappe.custom.doctype.property_setter.property_setter import make_property_setter

# Change a field property on an existing DocType
make_property_setter("Sales Invoice", "customer", "reqd", 1, "Check")
make_property_setter("Sales Invoice", "posting_date", "default", "Today", "Text")

Full customization reference: references/customization.md

Data Masking (v16+)

Fields with mask=1 hide sensitive values from users without mask permission at the field's permlevel. The server replaces values with patterns like XXXXXXXX before sending to the client. Administrator ALWAYS sees unmasked values.

json
{ "fieldname": "phone", "fieldtype": "Data", "options": "Phone", "mask": 1, "permlevel": 1 }

Full masking reference: references/data-masking.md

Python Type Stubs

Frappe auto-generates type annotations in controller files via TypeExporter. Fields get DF.* types inside a TYPE_CHECKING guard:

python
if TYPE_CHECKING:
    from frappe.types import DF
    customer: DF.Link
    items: DF.Table[SalesInvoiceItem]
    status: DF.Literal["Draft", "Submitted", "Paid"]

NEVER modify code between # begin: auto-generated types and # end: auto-generated types.

Full type stubs reference: references/type-stubs.md

Critical Rules

  1. ALWAYS name DocTypes in singular form ("Sales Invoice", not "Sales Invoices").
  2. ALWAYS use the tab prefix mentally -- the DB table is tabSales Invoice.
  3. NEVER exceed 140 characters for Data/Link/Select field values.
  4. ALWAYS set search_index=1 on fields used in frequent filters or get_list calls.
  5. ALWAYS set in_standard_filter=1 on fields users frequently filter by.
  6. NEVER use allow_on_submit=1 on child table fields that affect calculations without recalculating totals.
  7. ALWAYS set fetch_if_empty=1 alongside fetch_from unless you want to overwrite user edits.
  8. NEVER define depends_on with raw Python -- use eval:doc.fieldname == "value" syntax.

See Also

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Frappe Syntax Doctypes AI skill do?

Use when creating or modifying DocType JSON definitions, choosing fieldtypes, configuring naming rules, adding child tables, or setting up tree structures. Prevents invalid DocType configurations from wrong fieldtype choices, broken naming rules, and misconfigured child table links. Covers DocType JSON schema, all fieldtypes and their properties, autoname/naming_rule patterns, child table (Table fieldtype), tree DocTypes, virtual DocTypes, Single DocTypes. Keywords: DocType, fieldtype, naming_rule, autoname, child table, tree, virtual DocType, Single, JSON definition, Custom Field, Customiz...

Why use Frappe Syntax Doctypes on TypingMind?

Because you install it once and use it with any model. Frappe Syntax Doctypes is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Frappe Syntax Doctypes in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-doctypes. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Frappe Syntax Doctypes?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Frappe Syntax Doctypes?

As many as you like. As long as a model supports skills, you can use Frappe Syntax Doctypes with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Frappe Syntax Doctypes AI skill free?

Yes. It is published on GitHub by Impertio-Studio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇