Frappe Agent Debugger logo

Frappe Agent Debugger

Organization
Impertio-Studio
frappe-agent-debugger

Use when debugging Frappe errors, using bench console for live inspection, analyzing tracebacks, or reading Frappe log files. Prevents wasted debugging time from ignoring log context, misreading tracebacks, and not using bench console effectively. Covers bench console, frappe.logger, error log DocType, traceback analysis, common error patterns, log file locations, pdb/debugger integration, VS Code DAP, profiling, Frappe Recorder, mariadb diagnostics. Keywords: debug, bench console, traceback, error log, frappe.logger, pdb, debugging, log analysis, inspect, VS Code, DAP, profiling, recorder, mariadb, monitor, ERPNext error, how to debug, find the bug, what went wrong, stack trace, error message..

Overview

PublisherImpertio-Studio
RepositoryFrappe_Claude_Skill_Package
Skill namefrappe-agent-debugger
Stars
180
Forks
53
Bundled files
4
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.

  • 4 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 Agent Debugger 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/agents/frappe-agent-debugger .claude/skills/frappe-agent-debugger
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Frappe Agent Debugger 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 Agent Debugger 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 Agent Debugger 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.

Frappe Debugging Agent

Systematically diagnoses Frappe/ERPNext issues by classifying errors, locating relevant code, and applying targeted diagnosis checklists.

Purpose: Eliminate trial-and-error debugging — follow a deterministic diagnostic workflow.

When to Use This Agent

ERROR ANALYSIS TRIGGER
|
+-- Python traceback or error message
|   "ImportError: cannot import name X from frappe"
|   --> USE THIS AGENT
|
+-- JavaScript console error
|   "Uncaught TypeError: frm.set_value is not a function"
|   --> USE THIS AGENT
|
+-- Silent failure (no error, wrong behavior)
|   "Server Script runs but nothing happens"
|   --> USE THIS AGENT
|
+-- Scheduler/background job failure
|   "Job X failed" in scheduler logs
|   --> USE THIS AGENT
|
+-- Build/asset errors
|   "Module not found" or blank page after build
|   --> USE THIS AGENT

Debugging Workflow

STEP 1: CLASSIFY ERROR TYPE
  Python | JavaScript | Database | Permission | Hook | Scheduler | Build

STEP 2: IDENTIFY THE MECHANISM
  Controller | Server Script | Client Script | Hook | Scheduler | API

STEP 3: LOCATE RELEVANT CODE
  Use Frappe file path conventions to find source

STEP 4: APPLY DIAGNOSIS CHECKLIST
  Run type-specific checklist for the error class

STEP 5: SUGGEST FIX
  Provide corrected code + reference relevant frappe-* skills

See references/workflow.md for detailed steps.

Step 1: Error Classification

Error TypeIndicatorsPrimary Tool
PythonTraceback with .py filesbench console, logs
JavaScriptBrowser console error, cur_frm issuesBrowser DevTools
DatabaseOperationalError, IntegrityErrorbench mariadb
Permissionfrappe.PermissionError, 403 responsesPermission Inspector
HookErrors after bench migrate, wrong eventsbench doctor
Schedulerbench doctor warnings, RQ failuresScheduler logs
BuildMissing assets, blank page, module errorsbench build --verbose

Step 2: Mechanism Identification

SymptomLikely Mechanism
Error during form save/submitController or Server Script (validate/on_submit)
Error on page loadClient Script or Web Template
Error message from API callWhitelisted method or REST API handler
Error in backgroundScheduler event or frappe.enqueue() job
Error after bench migrateHook configuration or patch
Error after bench buildFrontend asset pipeline

Step 3: File Path Conventions

ALWAYS check these locations based on the mechanism:

MechanismFile Path Pattern
Controllerapps/{app}/{app}/{module}/{doctype}/{doctype}.py
Server ScriptDesk > Server Script list (stored in DB)
Client ScriptDesk > Client Script list (stored in DB)
hooks.pyapps/{app}/{app}/hooks.py
Schedulerapps/{app}/{app}/tasks.py or hooks.py scheduler_events
Whitelistedapps/{app}/{app}/{module}/*.py (search for @frappe.whitelist)
Jinjaapps/{app}/{app}/templates/
Patchesapps/{app}/{app}/patches/

Step 4: Diagnosis Checklists (Quick Reference)

Python Errors

Error PatternLikely CauseFix
AttributeError: 'NoneType'frappe.get_doc() returned NoneCheck document exists first
ValidationErrorfrappe.throw() in validateRead the message — it IS the diagnosis
ImportErrorWrong import path or Server Script using importsServer Scripts CANNOT import
LinkValidationErrorReferenced document does not existVerify Link field target exists
TimestampMismatchErrorConcurrent edit conflictReload document before save
DuplicateEntryExceptionUnique constraint violationCheck naming series or unique fields
MandatoryErrorRequired field is emptySet field before save/submit
InvalidStatusErrorWrong docstatus transitionFollow 0→1→2 sequence
CircularLinkingErrorSelf-referencing parent-childFix document hierarchy

JavaScript Errors

Error PatternLikely CauseFix
frm.X is not a functionWrong API or stale codeClear cache, check API name
cur_frm is undefinedCode runs outside form contextUse frm from handler parameter
Uncaught PromiseMissing async/await on frappe.callAdd callback or await
field undefined in frm.docField does not exist on DocTypeCheck fieldname spelling
Form not refreshingMissing frm.refresh_fields()Add refresh after set_value

Database Errors

Error PatternLikely CauseFix
OperationalError: 1054Column does not existRun bench migrate
OperationalError: 1146Table does not existRun bench migrate
IntegrityError: 1062Duplicate primary keyCheck naming/autoname
IntegrityError: 1452Foreign key violationLinked document missing
OperationalError: 1213DeadlockReduce transaction scope
InternalError: 1366Invalid character for charsetCheck input encoding

Permission Errors

Error PatternLikely CauseFix
frappe.PermissionErrorUser lacks role permissionCheck Role Permission Manager
403 on API callMissing frappe.has_permission() or wrong @frappe.whitelist(allow_guest=True)Add permission check or guest flag
Empty list viewUser Permissions filteringCheck User Permission for that user
Cannot submitNo Submit permission for roleAdd Submit perm in DocType

Debug Tools

bench console (Python REPL)

bash
bench --site {site} console
# Then:
frappe.get_doc("Sales Invoice", "SINV-00001")  # Inspect document
frappe.db.sql("SELECT name FROM `tabSales Invoice` LIMIT 5")  # Raw SQL
frappe.get_hooks("doc_events")  # Inspect active hooks
frappe.get_all("Server Script", filters={"disabled": 0}, fields=["name", "script_type"])

bench mariadb (SQL shell)

bash
bench --site {site} mariadb
-- Then:
SHOW CREATE TABLE `tabSales Invoice`;
SELECT * FROM `tabError Log` ORDER BY creation DESC LIMIT 10;

bench doctor

bash
bench doctor  # Check scheduler, workers, background jobs

frappe.logger()

python
logger = frappe.logger("my_debug", allow_site=True)
logger.info(f"Variable value: {my_var}")
# Logs to: sites/{site}/logs/my_debug.log

Browser DevTools

Console tab  → JavaScript errors
Network tab  → Failed API calls (check response body for traceback)
Application tab → Session/cookie issues

Log File Locations

LogPathContains
Frappe websites/{site}/logs/frappe.logWeb request errors
Workersites/{site}/logs/worker.logBackground job errors
Schedulersites/{site}/logs/scheduler.logScheduled task output
Custom loggersites/{site}/logs/{name}.logfrappe.logger("{name}") output
Bench~/.bench/logs/bench.logBench command output
Error Log DocTypeDesk > Error LogUI-accessible error records
Supervisor/var/log/supervisor/Process manager logs
nginx/var/log/nginx/HTTP request/proxy errors

Common Error Patterns Table

Error MessageLikely CauseFixRelevant Skill
Import not allowed in Server ScriptsUsing import in Server ScriptUse frappe.utils.* or move to Controllerfrappe-errors-serverscripts
Cannot read properties of undefinedJS accessing field before form loadAdd frm.doc.field null checkfrappe-errors-clientscripts
DocType X not foundMissing app install or migrationbench migrate or bench install-appfrappe-ops-bench
Scheduler is not runningWorkers stoppedbench doctor, restart workersfrappe-ops-bench
BrokenPipeErrorgunicorn timeout on long operationUse frappe.enqueue() for long tasksfrappe-impl-scheduler
ModuleNotFoundErrorPython package not installedbench pip install {pkg}frappe-ops-bench
Duplicate nameName collision in naming seriesCheck autoname or naming_seriesfrappe-syntax-doctypes
Insufficient PermissionMissing role for operationCheck Role Permissionsfrappe-core-permissions
Cannot edit submitted documentModifying docstatus=1 docUse amend_doc() or cancel firstfrappe-errors-controllers
Invalid columnSchema out of syncbench migratefrappe-errors-database

Agent Output Format

ALWAYS produce debugging output in this format:

markdown
## Debug Report

### Error Classification
**Type**: [Python/JS/Database/Permission/Hook/Scheduler/Build]
**Mechanism**: [Controller/Server Script/Client Script/Hook/etc.]

### Root Cause
[One-sentence diagnosis]

### Evidence
- [What log/traceback line confirms this]
- [What code path is involved]

### Fix
[Corrected code or configuration change]

### Verification Steps
1. [How to confirm the fix works]
2. [What to check in logs/UI]

### Referenced Skills
- `frappe-*`: [what was consulted]

Debugging Decision Tree

ERROR RECEIVED
|
+-- Has traceback?
|   +-- YES: Read LAST line first (actual error)
|   |   +-- Contains ".py" --> Python error (Step 4: Python checklist)
|   |   +-- Contains "SQL" --> Database error (Step 4: Database checklist)
|   +-- NO: Check browser console
|       +-- Has JS error --> JavaScript error (Step 4: JS checklist)
|       +-- No error visible --> Silent failure
|           +-- Check Error Log DocType
|           +-- Check frappe.log
|           +-- Add frappe.logger() statements
|
+-- Error after bench command?
|   +-- After migrate --> Hook/schema issue
|   +-- After build --> Frontend asset issue
|   +-- After update --> Version compatibility issue
|
+-- Intermittent error?
    +-- Check scheduler logs
    +-- Check worker logs
    +-- Check for race conditions (TimestampMismatchError)

See references/checklists.md for complete diagnosis checklists. See references/examples.md for debugging walkthrough examples. See references/advanced-debugging.md for VS Code DAP setup, bench console patterns, mariadb diagnostics, and profiling tools.

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 Agent Debugger AI skill do?

Use when debugging Frappe errors, using bench console for live inspection, analyzing tracebacks, or reading Frappe log files. Prevents wasted debugging time from ignoring log context, misreading tracebacks, and not using bench console effectively. Covers bench console, frappe.logger, error log DocType, traceback analysis, common error patterns, log file locations, pdb/debugger integration, VS Code DAP, profiling, Frappe Recorder, mariadb diagnostics. Keywords: debug, bench console, traceback, error log, frappe.logger, pdb, debugging, log analysis, inspect, VS Code, DAP, profiling, recorder,...

Why use Frappe Agent Debugger on TypingMind?

Because you install it once and use it with any model. Frappe Agent Debugger 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 Agent Debugger 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/agents/frappe-agent-debugger. 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 Agent Debugger?

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 Agent Debugger?

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

Is the Frappe Agent Debugger 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 👇