nocobase-app-plugin-file
하는 일
이 스킬은 NocoBase 3 앱에 파일 컬렉션, 업로드, 다운로드, 미리 보기를 추가합니다. 업무 레코드에 첨부 파일이 필요한 개발자를 위한 스킬입니다.
사용하는 경우
- ✓사용자가 업무 레코드에 파일을 첨부하기를 원할 때.
- ✓앱에서 Word, Excel, PowerPoint 파일을 미리 보고 싶을 때.
- ✓UI 라이브러리의 파일 컴포넌트를 페이지에 추가해야 할 때.
스킬 링크
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-file/skills/nocobase-app-plugin-file/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자가 각 주문에 파일을 첨부하고, 제 NocoBase 앱에서 Word나 Excel 첨부 파일을 미리 볼 수 있게 해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 파일 플러그인의 서비스와 라우트 도우미를 사용하고, 앱에 필요한 컬렉션, 페이지, 권한을 추가합니다. 사용할 수 있는 곳에서는 포함된 파일 미리 보기 컴포넌트를 재사용합니다.
기술 내용 (원본 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
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
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에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.