frappe-agent-debugger
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "frappe-agent-debugger":https://skillpi.com/zh/skills/deepskill-eab89d4f24e098803d8285d491dbc998d3f088fc1ebfa581d7ade798c8d513b7。安装前核对上游来源和版本:https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于调试 Frappe 错误,包括使用 bench console 进行实时检查、分析堆栈跟踪和阅读 Frappe 日志文件。旨在避免忽略日志上下文或误读堆栈跟踪造成的调试浪费,涵盖 bench console、frappe.logger、错误日志 DocType、堆栈分析、日志文件位置、pdb/调试器集成、VS Code DAP、性能分析、Frappe Recorder 与 MariaDB 诊断等内容。
介绍来源: third_party · Impertio-Studio · 2.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: frappe-agent-debugger
description: >
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..
license: MIT
compatibility: "Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16."
metadata:
author: OpenAEC-Foundation
version: "2.0"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 Type | Indicators | Primary Tool |
|---|---|---|
| Python | Traceback with .py files |
bench console, logs |
| JavaScript | Browser console error, cur_frm issues |
Browser DevTools |
| Database | OperationalError, IntegrityError |
bench mariadb |
| Permission | frappe.PermissionError, 403 responses |
Permission Inspector |
| Hook | Errors after bench migrate, wrong events |
bench doctor |
| Scheduler | bench doctor warnings, RQ failures |
Scheduler logs |
| Build | Missing assets, blank page, module errors | bench build --verbose |
Step 2: Mechanism Identification
| Symptom | Likely Mechanism |
|---|---|
| Error during form save/submit | Controller or Server Script (validate/on_submit) |
| Error on page load | Client Script or Web Template |
| Error message from API call | Whitelisted method or REST API handler |
| Error in background | Scheduler event or frappe.enqueue() job |
Error after bench migrate |
Hook configuration or patch |
Error after bench build |
Frontend asset pipeline |
Step 3: File Path Conventions
ALWAYS check these locations based on the mechanism:
| Mechanism | File Path Pattern |
|---|---|
| Controller | apps/{app}/{app}/{module}/{doctype}/{doctype}.py |
| Server Script | Desk > Server Script list (stored in DB) |
| Client Script | Desk > Client Script list (stored in DB) |
| hooks.py | apps/{app}/{app}/hooks.py |
| Scheduler | apps/{app}/{app}/tasks.py or hooks.py scheduler_events |
| Whitelisted | apps/{app}/{app}/{module}/*.py (search for @frappe.whitelist) |
| Jinja | apps/{app}/{app}/templates/ |
| Patches | apps/{app}/{app}/patches/ |
Step 4: Diagnosis Checklists (Quick Reference)
Python Errors
| Error Pattern | Likely Cause | Fix |
|---|---|---|
AttributeError: 'NoneType' |
frappe.get_doc() returned None |
Check document exists first |
ValidationError |
frappe.throw() in validate |
Read the message — it IS the diagnosis |
ImportError |
Wrong import path or Server Script using imports | Server Scripts CANNOT import |
LinkValidationError |
Referenced document does not exist | Verify Link field target exists |
TimestampMismatchError |
Concurrent edit conflict | Reload document before save |
DuplicateEntryException |
Unique constraint violation | Check naming series or unique fields |
MandatoryError |
Required field is empty | Set field before save/submit |
InvalidStatusError |
Wrong docstatus transition | Follow 0→1→2 sequence |
CircularLinkingError |
Self-referencing parent-child | Fix document hierarchy |
JavaScript Errors
| Error Pattern | Likely Cause | Fix |
|---|---|---|
frm.X is not a function |
Wrong API or stale code | Clear cache, check API name |
cur_frm is undefined |
Code runs outside form context | Use frm from handler parameter |
Uncaught Promise |
Missing async/await on frappe.call |
Add callback or await |
field undefined in frm.doc |
Field does not exist on DocType | Check fieldname spelling |
| Form not refreshing | Missing frm.refresh_fields() |
Add refresh after set_value |
Database Errors
| Error Pattern | Likely Cause | Fix |
|---|---|---|
OperationalError: 1054 |
Column does not exist | Run bench migrate |
OperationalError: 1146 |
Table does not exist | Run bench migrate |
IntegrityError: 1062 |
Duplicate primary key | Check naming/autoname |
IntegrityError: 1452 |
Foreign key violation | Linked document missing |
OperationalError: 1213 |
Deadlock | Reduce transaction scope |
InternalError: 1366 |
Invalid character for charset | Check input encoding |
Permission Errors
| Error Pattern | Likely Cause | Fix |
|---|---|---|
frappe.PermissionError |
User lacks role permission | Check Role Permission Manager |
| 403 on API call | Missing frappe.has_permission() or wrong @frappe.whitelist(allow_guest=True) |
Add permission check or guest flag |
| Empty list view | User Permissions filtering | Check User Permission for that user |
| Cannot submit | No Submit permission for role | Add Submit perm in DocType |
Debug Tools
bench console (Python REPL)
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)
bench --site {site} mariadb
-- Then:
SHOW CREATE TABLE `tabSales Invoice`;
SELECT * FROM `tabError Log` ORDER BY creation DESC LIMIT 10;
bench doctor
bench doctor # Check scheduler, workers, background jobs
frappe.logger()
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
| Log | Path | Contains |
|---|---|---|
| Frappe web | sites/{site}/logs/frappe.log |
Web request errors |
| Worker | sites/{site}/logs/worker.log |
Background job errors |
| Scheduler | sites/{site}/logs/scheduler.log |
Scheduled task output |
| Custom logger | sites/{site}/logs/{name}.log |
frappe.logger("{name}") output |
| Bench | ~/.bench/logs/bench.log |
Bench command output |
| Error Log DocType | Desk > Error Log | UI-accessible error records |
| Supervisor | /var/log/supervisor/ |
Process manager logs |
| nginx | /var/log/nginx/ |
HTTP request/proxy errors |
Common Error Patterns Table
| Error Message | Likely Cause | Fix | Relevant Skill |
|---|---|---|---|
Import not allowed in Server Scripts |
Using import in Server Script |
Use frappe.utils.* or move to Controller |
frappe-errors-serverscripts |
Cannot read properties of undefined |
JS accessing field before form load | Add frm.doc.field null check |
frappe-errors-clientscripts |
DocType X not found |
Missing app install or migration | bench migrate or bench install-app |
frappe-ops-bench |
Scheduler is not running |
Workers stopped | bench doctor, restart workers |
frappe-ops-bench |
BrokenPipeError |
gunicorn timeout on long operation | Use frappe.enqueue() for long tasks |
frappe-impl-scheduler |
ModuleNotFoundError |
Python package not installed | bench pip install {pkg} |
frappe-ops-bench |
Duplicate name |
Name collision in naming series | Check autoname or naming_series | frappe-syntax-doctypes |
Insufficient Permission |
Missing role for operation | Check Role Permissions | frappe-core-permissions |
Cannot edit submitted document |
Modifying docstatus=1 doc | Use amend_doc() or cancel first |
frappe-errors-controllers |
Invalid column |
Schema out of sync | bench migrate |
frappe-errors-database |
Agent Output Format
ALWAYS produce debugging output in this format:
## 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.
版本历史
-
v3.1.1
GitHub ↗
原版更新说明
## What's new Expanded Keywords in all skill descriptions with user-friendly, non-technical discovery terms. Skills are now easier to find when users describe problems in plain language instead of technical terminology. Examples of added terms: - Symptom-based: "app is slow", "nothing shows", "container won't start" - Beginner-friendly: "how do I start", "what is", "getting started" - Error messages: literal error text users would paste - Alternative names: common synonyms and abbreviations No skill content was changed. Only the Keywords line in SKILL.md frontmatter was expanded.
-
v3.1.0
GitHub ↗
原版更新说明
## What's new - package.json with agents.skills[] manifest for external discovery (60 skills) - agents/openai.yaml for OpenAI Codex - GitHub topic agentskills added - SKILLS_LOG.md added to .gitignore - Em-dashes replaced with colons in 31 SKILL.md section headings Enables discovery via npx skills add, skills.sh, LobeHub, and other platforms.
-
v3.0.0
GitHub ↗
原版更新说明
## Summary - **60 deterministic skills** for Frappe Framework v14-v16 (up from 53 in v2.0) - **~95% surface area coverage** (up from ~85%) - 7 new skills + 12 existing skills extended with new reference files ## New Skills (7) | Skill | Category | Coverage | |-------|----------|----------| | `frappe-core-translation` | core | i18n, _(), __(), CSV/PO files, string extraction | | `frappe-core-utils` | core | 140+ date, number, string, validation functions | | `frappe-syntax-print` | syntax | Print formats, PDF generation, Letter Head | | `frappe-syntax-query-builder` | syntax | frappe.qb, joins, aggregation, cross-DB | | `frappe-impl-workspace` | impl | Workspace builder, number cards, charts | | `frappe-core-logging` | core | frappe.logger(), Error Log, Sentry integration | | `frappe-core-search` | core | Link search, global search, SQLiteSearch FTS5 | ## Extended Skills (12) 13 new reference files added to existing skills covering: Controls API, Tree View, Portal Generators, Print Format decision tree, Email system, Module/Workspace shipping, complete Document API, custom bench commands, request lifecycle, advanced debugging (VS Code DAP), Frappe Packages, data masking (v16+), and Python type stubs. ## Stats | Category | Count | |----------|:-----:| | syntax/ | 13 | | core/ | 11 | | impl/ | 14 | | errors/ | 7 | | ops/ | 8 | | agents/ | 5 | | testing/ | 2 | | **Total** | **60** | ## Install ```bash git clone https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package.git cp -r Frappe_Claude_Skill_Package/skills/source/* ~/.claude/skills/ ```
-
v2.0.0
GitHub ↗
原版更新说明
## Frappe Claude Skill Package v2.0.0 Massive upgrade from 28 ERPNext-specific skills to **53 Frappe Framework skills** covering ~85% of the Frappe surface area. ### What's New - **25 new skills** across 3 new categories (ops, testing, agents) - **28 existing skills** fully rewritten with fresh research - **Renamed** from `erpnext-*` to `frappe-*` (all skills are Frappe Framework, not ERPNext-specific) - **7 categories**: syntax (11), core (7), impl (13), errors (7), ops (8), agents (5), testing (2) ### New Categories - **ops/** — Bench CLI, deployment, backup, performance, upgrades, frontend build, cloud - **testing/** — Unit/integration tests, CI/CD with GitHub Actions - **3 new agents** — debugger, migrator, architect ### Key Improvements - All skills verified against official Frappe docs (March 2026) - v16 features documented: `extend_doctype_class`, data masking, type annotations - MIT license (was LGPL-3.0) - Deterministic language throughout (ALWAYS/NEVER) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
-
v1.1.0
GitHub ↗
原版更新说明
V16 compatibility update and documentation improvements. ## Added - USAGE.md with platform-specific guides (Claude.ai, Claude Code, API) - Complete README overhaul with quick start guide ## Changed - All 28 skills updated for ERPNext/Frappe V16 compatibility - Agent Skills now follow standard skill structure - Improved validation: 28/28 skills pass all checks ## Fixed - V16-specific syntax changes in 9 skills - Agent SKILL.md files now under 500 lines
此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗
当前收录版本
2.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 针对 Frappe/ERPNext 开发者的高频调试需求,提供系统性的错误分类、定位和修复流程
- 涵盖 Python、JavaScript、数据库、权限等多种错误类型,并配有具体检查清单和工具使用方法
亮点
- 触发条件清晰明确,覆盖多种典型错误场景(traceback、console error、silent failure等)
- 关键词丰富且精准,能有效引导用户在正确场景调用该 Skill
待提升项
-
引用文件缺失 原报告严重程度:轻微
SKILL.md 中引用了 references/workflow.md、references/checklists.md、references/examples.md、references/advanced-debugging.md 四个文件,但均未传入
改进建议:请补充这些引用文件,或移除引用链接以避免用户困惑
亮点
- 文档结构完整,包含清晰的调试工作流、错误分类表和决策树
- 提供了详细的文件路径约定和常见错误模式对照表
待提升项
-
引用文件缺失 原报告严重程度:轻微
多个关键参考文档缺失,影响用户获取完整调试信息
改进建议:补充 references/ 目录下的所有引用文件以确保执行流程完整
亮点
- 提供了具体的命令行工具和代码示例,参数正确且可执行
- 覆盖了主要异常场景的诊断方法和修复建议
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 213 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。