Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

frappe-frontend-development冰沙前端开发

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

2,047

周安装

82

GitHub Stars

16

下载量

663
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frappe-frontend-development(冰沙前端开发)
来源仓库:https://github.com/lubusin/agent-skills
仓库路径:skills/frappe-frontend-development
安装命令:
npx skills add https://github.com/lubusin/agent-skills --skill frappe-frontend-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lubusin/agent-skills --skill frappe-frontend-development

简介

用于辅助前端页面、组件和样式逻辑开发维护。

  • 适合生成 React、Vue 或 CSS 代码,审查组件结构。
  • 使用时需结合项目设计系统和路由方式,避免孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认效果。
  • 建议保持与现有技术栈一致,确保兼容性。frappe-frontend-development 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Frappe Frontend Development

Build modern frontend applications using Frappe UI (Vue 3 + TailwindCSS) and portal pages.

When to use

  • Building a custom SPA frontend for a Frappe app
  • Using Frappe UI components (Button, Dialog, ListView, etc.)
  • Implementing data fetching with Resource, ListResource, DocumentResource
  • Creating portal/public-facing pages
  • Setting up Vue 3 frontend tooling inside a Frappe app

Inputs required

  • App name and whether frontend already exists
  • Frontend type (full SPA via Frappe UI, or portal pages)
  • Authentication requirements (logged-in users, guest access)
  • Key components and data resources needed

Procedure

0) Choose frontend approach

ApproachWhen to UseStack
Frappe UI SPACustom app frontendVue 3, TailwindCSS, Vite
Portal pagesSimple public pagesJinja + HTML, minimal JS
Desk extensionsAdmin UI enhancementsForm/List scripts (see frappe-desk-customization)

1) Scaffold Frappe UI frontend

# Inside your Frappe app directory
cd apps/my_app
npx degit frappe/frappe-ui-starter frontend

# Install dependencies
cd frontend
yarn

# Start dev server
yarn dev

2) Configure main.js

import { createApp } from 'vue'
import {
    FrappeUI,
    setConfig,
    frappeRequest,
    resourcesPlugin,
    pageMetaPlugin
} from 'frappe-ui'
import App from './App.vue'
import './index.css'

let app = createApp(App)

// Register FrappeUI plugin (components + directives)
app.use(FrappeUI)

// Enable Frappe response parsing
setConfig('resourceFetcher', frappeRequest)

// Optional: Options API resource support
app.use(resourcesPlugin)

// Optional: Reactive page titles
app.use(pageMetaPlugin)

app.mount('#app')

3) Fetch data with Resources

Generic Resource — for custom API calls:

import { createResource } from 'frappe-ui'

let stats = createResource({
    url: 'my_app.api.get_dashboard_stats',
    params: { period: 'monthly' },
    auto: true,
    cache: 'dashboard-stats',
    transform(data) {
        return { ...data, formatted_total: format_currency(data.total) }
    },
    onSuccess(data) { console.log('Loaded:', data) },
    onError(error) { console.error('Failed:', error) }
})

// Properties
stats.data       // Response data
stats.loading    // Boolean: request in progress
stats.error      // Error object if failed
stats.fetched    // Boolean: data fetched at least once

// Methods
stats.fetch()    // Trigger request
stats.reload()   // Re-fetch
stats.submit({ period: 'weekly' })  // Fetch with new params
stats.reset()    // Reset state

List Resource — for DocType lists with pagination:

import { createListResource } from 'frappe-ui'

let todos = createListResource({
    doctype: 'ToDo',
    fields: ['name', 'description', 'status'],
    filters: { status: 'Open' },
    orderBy: 'creation desc',
    pageLength: 20,
    auto: true,
    cache: 'open-todos'
})

// List-specific API
todos.data              // Array of records
todos.hasNextPage       // Boolean: more pages
todos.next()            // Load next page
todos.reload()          // Refresh list

// CRUD operations
todos.insert.submit({ description: 'New task' })
todos.setValue.submit({ name: 'TODO-001', status: 'Closed' })
todos.delete.submit('TODO-001')
todos.runDocMethod.submit({ method: 'send_email', name: 'TODO-001' })

Document Resource — for single document operations:

import { createDocumentResource } from 'frappe-ui'

let todo = createDocumentResource({
    doctype: 'ToDo',
    name: 'TODO-001',
    whitelistedMethods: {
        sendEmail: 'send_email',
        markComplete: 'mark_complete'
    },
    onSuccess(doc) { console.log('Loaded:', doc.name) }
})

// Document API
todo.doc                 // Full document object
todo.reload()            // Refresh document

// Update fields
todo.setValue.submit({ status: 'Closed' })

// Debounced update (coalesces rapid changes)
todo.setValueDebounced.submit({ description: 'Updated' })

// Call whitelisted methods
todo.sendEmail.submit({ email: 'user@example.com' })

// Delete
todo.delete.submit()

4) Use Frappe UI components

<template>
    <div class="p-4">
        <Button variant="solid" theme="blue" @click="showDialog = true">
            Add Todo
        </Button>

        <ListView :columns="columns" :rows="todos.data">
            <template #cell="{ column, row, value }">
                <Badge v-if="column.key === 'status'" :theme="value === 'Open' ? 'orange' : 'green'">
                    {{ value }}
                </Badge>
                <span v-else>{{ value }}</span>
            </template>
        </ListView>

        <Dialog v-model="showDialog" :options="{ title: 'New Todo' }">
            <template #body-content>
                <TextInput v-model="newDescription" placeholder="Description" />
            </template>
            <template #actions>
                <Button variant="solid" @click="addTodo">Save</Button>
            </template>
        </Dialog>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { Button, ListView, Badge, Dialog, TextInput, createListResource } from 'frappe-ui'

const showDialog = ref(false)
const newDescription = ref('')

const todos = createListResource({
    doctype: 'ToDo',
    fields: ['name', 'description', 'status'],
    auto: true
})

const columns = [
    { label: 'Description', key: 'description' },
    { label: 'Status', key: 'status', width: 100 }
]

function addTodo() {
    todos.insert.submit(
        { description: newDescription.value },
        { onSuccess() { showDialog.value = false; newDescription.value = '' } }
    )
}
</script>

Available component categories:

CategoryComponents
InputsTextInput, Textarea, Select, Combobox, MultiSelect, Checkbox, Switch, DatePicker, TimePicker, Slider, Password, Rating
DisplayAlert, Avatar, Badge, Breadcrumbs, Progress, Tooltip, ErrorMessage, LoadingText
NavigationButton, Dropdown, Tabs, Sidebar, Popover
LayoutDialog, ListView, Calendar, Tree
Rich ContentTextEditor (TipTap), Charts, FileUploader

5) Add directives and utilities

<script setup>
import { onOutsideClickDirective, visibilityDirective, debounce } from 'frappe-ui'

const vOnOutsideClick = onOutsideClickDirective
const vVisibility = visibilityDirective

const debouncedSearch = debounce((query) => {
    // Search logic
}, 500)
</script>

<template>
    <div v-on-outside-click="closeDropdown">...</div>
    <div v-visibility="onVisible">Lazy loaded content</div>
</template>

6) Configure TailwindCSS

// tailwind.config.js
module.exports = {
    presets: [
        require('frappe-ui/src/utils/tailwind.config')
    ],
    content: [
        './index.html',
        './src/**/*.{vue,js,ts}',
        './node_modules/frappe-ui/src/components/**/*.{vue,js,ts}'
    ]
}

7) Build for production

# Build frontend assets
cd frontend && yarn build

# Assets are served at /frontend by Frappe

8) Portal pages (alternative approach)

For simple public pages without a full SPA:

# In your app's website/ or www/ directory
# my_app/www/my_page.html

{% extends "templates/web.html" %}
{% block page_content %}
<h1>{{ title }}</h1>
<p>Welcome, {{ frappe.session.user }}</p>
{% endblock %}
# my_app/www/my_page.py
def get_context(context):
    context.title = "My Page"
    context.data = frappe.get_all("ToDo", filters={"owner": frappe.session.user})

Verification

  • yarn dev starts without errors
  • Components render correctly
  • Data resources fetch and display data
  • CRUD operations work (insert, update, delete)
  • Authentication works (login redirect, session handling)
  • yarn build completes successfully
  • Production assets serve correctly from Frappe

Failure modes / debugging

  • CORS errors: Set ignore_csrf for local dev; ensure proper CSRF token in production
  • 404 on API calls: Check method path; verify @frappe.whitelist() decorator
  • Component not found: Ensure import path is correct; check frappe-ui version
  • Styles broken: Verify TailwindCSS config includes frappe-ui component paths
  • Auth issues: Check session cookie; ensure site URL matches in dev proxy config

Escalation

  • For Desk UI scripting → frappe-desk-customization
  • For API endpoint implementation → frappe-api-development
  • For app architecture → frappe-app-development
  • For UI/UX patterns from official apps → frappe-ui-patterns

References

Guardrails

  • ALWAYS use Frappe UI for custom frontends: Never use vanilla JS, jQuery, or custom frameworks for app frontends — Frappe UI (Vue 3 + TailwindCSS) is the standard. This ensures consistency with CRM, Helpdesk, and other official Frappe apps.
  • Use FrappeUI components: Prefer <Button>, <Input>, <FormControl> over custom HTML for consistency
  • Follow CRM/Helpdesk app shell patterns: For CRUD apps, follow frappe-ui-patterns skill which documents sidebar navigation, list views, form layouts, and routing patterns from official Frappe apps
  • Handle loading states: Always show loading indicators during API calls; use resource.loading
  • Validate API responses: Check for errors before accessing data; handle exc responses
  • Configure proxy correctly: Dev server must proxy API calls to Frappe backend
  • Handle authentication: Check $session.user and redirect to login when needed

Common Mistakes

MistakeWhy It FailsFix
Missing CORS/proxy setupAPI calls fail in developmentConfigure Vite proxy to forward /api to Frappe site
Not handling auth stateApp crashes for logged-out usersCheck call('frappe.auth.get_logged_user') on mount
Wrong resource URLs404 errors on API callsUse createResource with correct method paths
Hardcoded site URLBreaks across environmentsUse relative URLs or environment variables
Not including CSRF tokenPOST requests failUse frappe.csrf_token or configure session properly
Missing TailwindCSS configFrappe UI styles brokenInclude frappe-ui in Tailwind content paths
Using vanilla JS/jQueryInconsistent UX, maintenance burdenAlways use Frappe UI for custom frontends
Custom app shell designInconsistent with ecosystemFollow CRM/Helpdesk patterns for navigation, lists, forms

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.41%
按下载量换算215

Claude

28.37%
按下载量换算188

Cursor

21.06%
按下载量换算140

Gemini CLI

10.02%
按下载量换算66

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills