laravel-filament

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<EXTREMELY-IMPORTANT> This skill exists to keep Filament work aligned with v5, not to duplicate the entire reference library.
Non-negotiable rules:
  1. Read
    references/namespaces.md
    first.
  2. Then load only the reference files the task actually needs.
  3. Keep business logic out of Resources.
  4. Use the v5 action and table APIs, not old v3 patterns.
  5. Keep the heavy Filament cookbook in
    references/
    , not inline here.
</EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT> 本技能旨在确保Filament开发工作与v5版本保持一致,而非复制整个参考库。
不可违背的规则:
  1. 首先阅读
    references/namespaces.md
  2. 仅加载任务实际需要的参考文件。
  3. 不要在Resources中存放业务逻辑。
  4. 使用v5的action和table API,而非旧的v3模式。
  5. 将复杂的Filament使用手册放在
    references/
    目录下,不要内联在此处。
</EXTREMELY-IMPORTANT>

laravel-filament

laravel-filament

Inputs

输入

  • $request
    : The Filament admin task or component to modify
  • $request
    : 要修改的Filament管理任务或组件

Goal

目标

Route Filament work through the correct v5 conventions so the implementation uses the right namespaces, table APIs, and admin-panel composition patterns.
通过正确的v5约定进行Filament开发工作,确保实现时使用正确的命名空间、表格API和管理面板组合模式。

Step 0: Read the v5 namespace contract

步骤0:阅读v5命名空间约定

Always start with:
  • references/namespaces.md
That establishes the namespace and API changes that commonly break Filament work.
Success criteria: The task is grounded in the correct Filament v5 surface before editing.
始终从以下文件开始:
  • references/namespaces.md
该文件定义了通常会导致Filament开发出错的命名空间和API变更。
成功标准:在开始编辑前,任务已基于正确的Filament v5 API完成准备。

Step 1: Load only the relevant admin references

步骤1:仅加载相关的管理参考文件

Use the routing table to pick reference files. Do not bulk-load everything.
TaskRead
v5 namespace and API changes
references/namespaces.md
Creating or editing a Resource (CRUD)
references/resources.md
Form fields, sections, layout
references/forms.md
Table columns, sorting, searching
references/tables.md
Bulk actions, row actions, header actions
references/actions.md
Table filters, filter forms
references/filters.md
Relation managers, BelongsToMany, HasMany
references/relationships.md
Dashboard widgets, stats, charts
references/widgets.md
Multi-panel setup, navigation, tenancy
references/panels.md
Flash messages, database notifications
references/notifications.md
Infolist entries, read-only views
references/infolists.md
Testing resources, pages, actions
references/testing.md
Multiple tasks? Read multiple files.
Success criteria: Only the task-relevant Filament conventions are in the active context.
使用路由表选择参考文件,不要批量加载所有文件。
任务阅读文件
v5命名空间和API变更
references/namespaces.md
创建或编辑Resource(CRUD)
references/resources.md
表单字段、区块、布局
references/forms.md
表格列、排序、搜索
references/tables.md
批量操作、行操作、头部操作
references/actions.md
表格过滤器、筛选表单
references/filters.md
关联管理器、BelongsToMany、HasMany
references/relationships.md
仪表盘小部件、统计数据、图表
references/widgets.md
多面板设置、导航、租户管理
references/panels.md
闪存消息、数据库通知
references/notifications.md
信息列表条目、只读视图
references/infolists.md
测试资源、页面、操作
references/testing.md
涉及多个任务?阅读多个文件。
成功标准:仅将与任务相关的Filament约定纳入当前上下文。

Step 2: Implement with the core Filament guardrails

步骤2:遵循核心Filament约束进行实现

Keep these rules active:
  • actions come from
    Filament\\Actions\\*
  • tables use the v5 record/toolbar/header action methods
  • badge presentation uses
    TextColumn->badge()
  • layout components come from the Schemas package
  • Resource classes delegate real business work to application Actions
Success criteria: The change uses valid v5 APIs and stays maintainable.
始终遵守以下规则:
  • 操作来自
    Filament\\Actions\\*
  • 表格使用v5的record/toolbar/header操作方法
  • 徽章展示使用
    TextColumn->badge()
  • 布局组件来自Schemas包
  • Resource类将实际业务工作委托给应用Actions
成功标准:修改使用有效的v5 API,且保持可维护性。

Step 3: Verify the admin surface

步骤3:验证管理面板界面

Use the narrowest relevant verification:
  • focused feature tests
  • Filament page/resource tests
  • lightweight UI smoke coverage if the repo already has it
Success criteria: The Filament surface still behaves correctly after the change.
使用最相关的窄范围验证方式:
  • 聚焦式功能测试
  • Filament页面/资源测试
  • 如果仓库已有相关覆盖,可进行轻量级UI冒烟测试
成功标准:修改后Filament界面仍能正常运行。

Guardrails

约束规则

  • Do not inline the whole Filament handbook in
    SKILL.md
    .
  • Do not skip
    references/namespaces.md
    .
  • Do not use v3 action namespaces or deprecated table methods.
  • Do not put business logic directly in Resource classes.
  • 不要将完整的Filament手册内联到
    SKILL.md
    中。
  • 不要跳过
    references/namespaces.md
  • 不要使用v3的操作命名空间或已弃用的表格方法。
  • 不要将业务逻辑直接放在Resource类中。

When To Load References

何时加载参考文件

  • references/namespaces.md
    Always.
  • then only the task-relevant files under
    references/
  • references/namespaces.md
    始终需要加载。
  • 然后仅加载
    references/
    下与任务相关的文件

Output Contract

输出约定

Report:
  1. which Filament references were loaded
  2. the v5 pattern applied
  3. the change made
  4. the verification run
报告内容:
  1. 加载了哪些Filament参考文件
  2. 应用的v5模式
  3. 所做的修改
  4. 执行的验证