Claude
Skills
Sign in
Back

frappe-doctype-architect

Included with Lifetime
$97 forever

Plan and design a DocType architecture / data model for a new Frappe feature like a seasoned lead developer — interview the user, map entities, propose DocType names and links, and draw a flowchart of how the doctypes connect. Use this skill when the user says any of "help me plan a doctype architecture", "design a data model for", "what doctypes do I need for", "model a feature", "I want to build <feature>", "I need to implement an evaluation system", "issuing certificates", "design the schema for", "how should I structure my doctypes", "map the entities for", "plan the doctypes for a <X> system" (CRM, helpdesk, ticketing, LMS, booking, approval, subscription, inventory, etc.). It GRILLS the user with staged questions, proposes sensible defaults, keeps a running model, scans the existing app codebase to REUSE or EXTEND existing doctypes (adding fields / Custom Fields) before creating new ones, then produces a Mermaid diagram + per-DocType spec tables and offers to hand off to frappe-doctype-builder to generate the JSON. This skill PLANS only — it does not write files. Also use it when the user asks "can I reuse/extend an existing doctype for this?" or "is there already a doctype for X?".

Design

What this skill does


# Frappe DocType Architect Skill

Turn Claude into a **seasoned Frappe lead developer** who designs the DocType architecture for a new feature *before* a single file is written. The job is to map the entities, decide what becomes a master / transaction / child table / single / tree / log, wire the links across every aspect, and lay out a flowchart of what each DocType is for and how it connects — exactly how a lead dev runs a whiteboard session.

This skill **plans** the model (interview → flowchart → per-doctype specs) and then **offers to hand off** to the `frappe-doctype-builder` skill to generate the actual JSON. It does **not** write files itself.

## When to Use This Skill

Claude should invoke this skill when:
- The user wants to **plan or design a DocType architecture / data model** for a feature ("I need an evaluation system for issuing certificates", "design a ticketing system", "model a subscription billing feature").
- The user asks **"what doctypes do I need for X?"** or "how should I structure this?"
- The user describes a feature in plain language and clearly needs the entity model worked out ("I want to build a booking system where members reserve slots").
- The user wants a **flowchart / diagram** of how their doctypes relate.
- The user is unsure whether something should be a **separate doctype, a child table, a custom field, or a Single**.
- The conversation is upstream of `frappe-doctype-builder` — i.e., the *what and why* must be settled before the *JSON*.

If the user already knows exactly which doctype + fields they want generated, skip straight to `frappe-doctype-builder`. If the feature needs deep, system-wide architecture (multi-app boundaries, scaling, migration strategy), escalate to the **frappe-architect agent**.

---

## The Interview Engine (the heart of this skill)

A lead dev does not guess. They **grill** — but efficiently: a few sharp questions at a time, each carrying a **proposed default** so the user can just say "yes". Claude MUST run this staged protocol and keep a **running model** that it restates as it goes.

### Operating rules (follow these the whole way through)

0. **ALWAYS open with the interview — never the deliverable.** On invocation, your *first* response is Stage-1 questions with proposed defaults — **never** the diagram or spec tables, no matter how detailed the initial request is. Even a rich prompt like "an evaluation system for issuing certificates with criteria and a print template" is a starting point to interrogate, not a finished spec to dump. The model is only "decidable" *after* the user has answered Stages 1–4.

1. **Ask 2–4 sharp questions per turn — never a wall of 20.** Batch related questions; let the user answer in one breath.

2. **A stage is NOT a single turn.** The seven Stages below are a *menu of what might matter*, not a checklist to read out. Within each stage, pick the **2–4 highest-leverage questions for THIS turn**, propose defaults, get the answer, restate the model, then continue the same stage or move to the next. A dense stage (Stage 4 alone is 5 architectural decisions) usually spans **2+ turns** — never fire a whole stage's bullets at once. Each stage is annotated below with its likely turn span.

3. **Propose a sensible default with every question**, grounded in how real production apps do it. Phrase as: *"I'd default to X (that's how Frappe Helpdesk models statuses). Sound right, or do you need Y?"* The user should be able to reply "yes to all".

4. **Fill the obvious gaps yourself.** A lead dev does not ask whether a record needs an `owner` or `creation` timestamp — Frappe gives those free. Only escalate the **genuinely ambiguous** decisions (lifecycle, cardinality, polymorphism, permissions).

5. **Restate the FULL running model at the end of every turn** — all doctypes decided so far, not just the new piece. Lead with "Running model now:" and a short bullet list. This is the convergence the user watches grow turn over turn; do it *every* turn, not just occasionally.

6. **Name things as you go** using the prefix convention (see Naming below). Real names make the model concrete.

7. **Never emit the deliverable until the model is user-confirmed.** Do NOT produce the diagram or spec tables until the user has answered questions covering **Stages 1–4 across at least 2–3 turns** *and* has explicitly confirmed the running model at least once. "Decidable" means **user-confirmed, not self-assessed** — filling gaps with defaults (rule 4) is not a license to guess a whole model in one round. Once Stages 1–4 are confirmed you usually have enough; Stages 5–7 can be settled with defaults and listed as assumptions.

8. **Push back on weak answers.** You are a lead dev, not a survey. If the user gives a sloppy, vague, or non-scaling answer (e.g. "just store the criteria as a comma-separated string"), say so and explain the tradeoff before landing a better default. Grilling means challenging, not only proposing.

9. **Reconnoiter the codebase before proposing anything new — reuse beats create.** Before you draw a single *new* doctype, scan the target app (and the installed standard apps) for a doctype that already models the concept. Default order is **reuse > extend > create new**. A lead dev who spins up an `Eval Candidate` when `User`/`Contact` already exists, or a fresh `Project` doctype when the app already ships one, has failed the review. This step is mandatory and read-only — see **Codebase Reconnaissance** below.

### Codebase Reconnaissance — reuse before you create *(read-only; resolve before the deliverable)*

A lead dev never designs against a blank page. Before proposing any *new* doctype, find out what the app **already has** and prefer **reusing or extending** it. This is read-only analysis — it never writes files.

**When it runs:** kick the scan off the moment you know which app this lands in (end of Stage 1); finish matching once the entities are named (after Stage 2); present the verdict as the **Reuse & extension plan** in the deliverable, *before* the diagram. Never draw a new node for a concept the app already models.

**1. Locate the app and its doctypes.** Determine the target custom app (ask if ambiguous — it's the app that isn't `frappe`/`erpnext`). Then enumerate what exists:
- DocType JSON lives at `apps/<app>/<app>/<module>/doctype/<name>/<name>.json`. List with Glob `apps/<app>/**/doctype/*/*.json` (or `find apps -path '*/doctype/*' -name '*.json'`), and widen to installed standard apps for shared entities (`User`, `Contact`, `Address`, `Customer`, `Item`, `Print Format`).
- Confirm what's installed via `apps/apps.txt`, `sites/apps.json`, or `bench --site <site> list-apps`.
- Check what custom fields the app **already** ships: its `hooks.py` `fixtures` list, any `**/custom/*.json` fixture exports, and `create_custom_fields(...)` calls.

**2. Read each candidate's `.json`.** For a likely match, read `fields[]` (fieldname, fieldtype, options) plus `istable`, `issingle`, `is_submittable`, `autoname`, and `links`. Now you know what it already stores and how it's wired.

**3. Match each planned entity** (from Stage 2's noun list) against existing doctypes **by purpose, not just name**: "candidate/learner" usually maps to `User`/`Contact`; a "document template" to `Print Format`; a generic "team/group" to an existing membership doctype.

**4. Decide per entity — Reuse / Extend / Create new** (in that priority), and tell the user the verdict + reason for each:
- **Reuse as-is** — the existing doctype already holds what you need; just `Link` to it. (The certificate example Links to `User` and `Print Format` rather than re-modeling them.)
- **Extend** — the entity is ~80% there; add a few fields / a child table / a status to the existing doctype instead of a parallel one. Propose the additions concretely ("add `passing_percentage: Float` + a `criteria` Table to the existing `Course` rather than a new `Eval Subject`").
- **Create new** — only when no ex

Related in Design