nocobase-app-plugin-file
Что он делает
Этот скилл добавляет в приложение NocoBase 3 коллекции файлов, загрузку, скачивание и просмотр. Он нужен разработчикам, которым нужны вложения к бизнес-записям.
Когда использовать
- ✓Когда вы хотите, чтобы пользователи прикрепляли файлы к бизнес-записям в приложении NocoBase.
- ✓Когда нужен просмотр файлов Word, Excel или PowerPoint в приложении.
- ✓Когда нужно добавить компоненты для файлов из библиотеки UI на страницу.
Ссылка на скилл
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-file/skills/nocobase-app-plugin-file/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Дайте пользователям возможность прикреплять файлы к каждому заказу и просматривать вложения Word или Excel в моём приложении NocoBase.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ использует сервисы плагина файлов и вспомогательные функции маршрутов, затем добавляет коллекции, страницы и права, которые нужны приложению. Он использует включенные компоненты предпросмотра там, где они доступны.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Add files to an App
Use @nocobase/app-plugin-file/server and @nocobase/app-plugin-file/client. The plugin provides Repository managers, service tokens, and route helpers. The UI Library provides @nocobase/file-component-ui. The App or business plugin owns collections, migrations, Drive configuration, resource routes, permissions, and pages.
Inspect the App's existing registrations, migrations, disks, and resources first. Register the Server default export and the Client default factory before consumers, using the App's plugin lifecycle commands. The core does not create collections or routes.
Find and reuse the preview UI first
Inspect client/extensions/nocobase-file-component-ui/ before writing upload or preview components. Current Default templates preinstall this application-owned UI Library source and its client dependencies; older applications and other templates may not. Import from its index.ts, not from plugin-internal paths. Registering the plugin supplies services and translations; it does not automatically install or upgrade the copied UI.
| Format | UI Library preview | Content access |
|---|---|---|
| DOCX / XLSX / PPTX | Local @silurus/ooxml viewer |
Same-origin session credentials; no public URL or third-party service required |
| Raster image / PDF / text / Markdown / audio / video | Built-in preview components | See the content access rules below |
| Legacy DOC / XLS / PPT and OpenDocument | Office Online fallback | Internet-accessible absolute URL; cannot use the App session |
| Unsupported or unsafe active content | Explanation and optional download | Download still requires permission |
To show a record's files as thumbnails and chips, or take uploads beside a form or a comment, install the UI Library's attachment-list component (yes n | pnpm exec shadcn add @nocobase/attachment-list; its example is @nocobase/attachment-list-demo), map file records to AttachmentFile, and open FilePreviewDialog from its onPreview. For custom attachment lists, uploads or business associations, reuse FilePreviewDialog with file records and contentUrl; it requires no repository prop. Extend the existing UI or add the necessary content adapter rather than reimplementing format detection and dropping supported formats. A DOCX download fallback indicates a request/rendering failure or an outdated/custom component, not that the plugin lacks DOCX support. Report the actual failure and preserve its evidence.
If the installed package, synchronized Skill and copied UI disagree, inspect the resolved plugin version, run pnpm nocobase skills sync to refresh guidance, and reconcile the UI source separately. Skills synchronization does not upgrade UI Library copies.
Work incrementally
- Use standard File Repository routes, the Client File Repository and UI Library components for new attachment features. Save associations through the existing business API, whether standard CRUD or custom routes; do not migrate working business routes just to add files.
- Extend existing services, middleware, response adapters or installed UI components where needed. A necessary compatibility handler should delegate to File Repository; do not rebuild upload, storage and metadata handling with Drive or replace the whole CRUD stack.
- Inspect the App's registration, collection, disk and business save path together. Reuse what works; do not ask the user to choose an implementation or repeatedly explore source when the documented contract suffices.
- Verify one small upload → metadata query → content download before building UI. Then wire the returned IDs into the existing save/detail flow. Retain uploaded IDs if the business save fails, and run the affected checks after edits stabilize.
The following business example uses collection invoice_files, resource invoiceAttachments, connection main, and disk local. Adapt these to the App.
Collection
Create an App-owned, self-contained migration under database/main/migrations/ with
Частые вопросы
Создает ли плагин таблицы для файлов автоматически?
Нет. Коллекции, миграции и маршруты принадлежат приложению или бизнес-плагину.
Где хранятся файлы?
В хранилище, которое настроено в приложении.
Какие виды предпросмотра поддерживаются?
Скилл описывает предпросмотр Word, Excel и PowerPoint.
Подробности
Оригинальное описание автора
Add file collections, uploads, downloads, DOCX/XLSX/PPTX previews, business attachments, and editable UI Library file components to a NocoBase 3 App using the public File Repository services.
repo: nocobase/nocobase
Популярность
- Звёзды на GitHub
- 25k
- Место в рейтинге
- #10097
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
nocobase-app-development
25kПомогает агенту создать страницы, маршруты, данные, права доступа и тесты для полного бизнес-приложения на NocoBase 3.
shadcn
25kПомогает агенту находить, добавлять, исправлять и оформлять компоненты shadcn/ui в веб-проекте по их официальной документации и реестрам.
nocobase-app-plugin-development
25kПомогает агенту создавать и поддерживать плагины NocoBase 3 внутри существующего приложения: серверную и клиентскую часть, базу данных и регистрацию.
nocobase-app-upgrade
25kПомогает агенту обновить приложение NocoBase до более новой версии шаблона, перенося изменения шаблона и сохраняя вашу собственную работу.
Похожие скиллы
api-connector-builder
280kАгент создаёт новые подключения к API по существующему шаблону. Используйте, когда нужна ещё одна интеграция без нового способа делать то же самое.
api-design
280kПомогает агенту проектировать REST API по лучшим практикам: как API общаются, как показываются ошибки и как организовать данные.
backend-patterns
280kПомогает агенту с архитектурными паттернами серверной части и оптимизацией баз данных. Полезен при создании и проверке серверного кода.