From fnos-plugin-dev
Use this skill when the user wants to create a fnOS (飞牛OS) NAS plugin, build an .fpk package, develop a fnOS app, or asks about fnOS plugin development. Scaffolds complete plugin projects with build scripts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fnos-plugin-dev:fnos-pluginThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create complete 飞牛OS (fnOS) native `.fpk` plugin projects. This skill scaffolds the full directory structure, config files, lifecycle scripts, Python backend, Vue frontend, and a one-click build script.
Create complete 飞牛OS (fnOS) native .fpk plugin projects. This skill scaffolds the full directory structure, config files, lifecycle scripts, Python backend, Vue frontend, and a one-click build script.
The user provides: $ARGUMENTS in the format <plugin-name> <display-name> <port>.
photo-viewer"Photo Viewer"8590Create apps/<plugin-name>/ with this structure:
apps/<plugin-name>/
├── fnos/
│ ├── manifest # App metadata
│ ├── ICON.PNG # 64x64 placeholder icon
│ ├── ICON_256.PNG # 256x256 placeholder icon
│ ├── <AppName>.sc # Firewall port rules
│ ├── bin/<plugin-name>-server # Shell launcher
│ ├── app/
│ │ ├── server.py # Python 3 stdlib HTTP backend
│ │ └── static/index.html # Vue 3 CDN single-page frontend
│ ├── cmd/service-setup # fnOS lifecycle hooks
│ ├── config/privilege # Run-as permissions
│ ├── config/resource # Port and resource config
│ ├── ui/config # Desktop launcher JSON
│ ├── ui/images/64.png # Launcher icon
│ └── wizard/config # Install wizard JSON
└── build.sh # One-click packager → .fpk
Use the templates in references/config-templates.md to generate each config file. Replace all {plugin-name}, {display-name}, {port} placeholders.
Use the template in references/service-setup-template.md. This file is critical — it MUST include the ui/ symlink fix in service_postinst().
A shell script that launches Python:
#!/bin/sh
APP_DIR="${TRIM_APPDEST}"
APP_DATA_DIR=$1
export HOME="$APP_DATA_DIR"
cd "$APP_DIR" || exit 1
exec python3 ./app/server.py --port "${TRIM_SERVICE_PORT:-<port>}" --data-dir "$APP_DATA_DIR"
Python 3 stdlib HTTP server skeleton with:
HTTPServer + custom handlerapp/static/do_GET / do_POST)argparse for --port and --data-dirsignal handlers for SIGTERM/SIGINTVue 3 CDN single-page app with:
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js">setup())fetch() API wrapperUse Node.js to generate solid-color PNG files (64x64 and 256x256) using zlib. If node is unavailable, create minimal valid PNGs.
This is the most complex file. It must:
app/, bin/, ui/ into app.tgzshared/cmd/common lifecycle framework (~300 lines)cmd/main, cmd/installer, and all hook scriptscmd/service-setup from the app<name>_<version>_<platform>.fpk (tar.gz)Use the complete build.sh reference in references/build-script.md.
After generation, tell the user:
server.py to implement business logicindex.html to implement UIbash build.sh to package.fpk to fnOS → App Center → Manual Install/var/apps/<name>/cmd/main status|start|logThese are real issues discovered during development — not theoretical:
ui/ symlink is REQUIRED: fnOS does NOT auto-extract ui/ from the fpk to /var/apps/. You must put ui/ inside app.tgz AND create a symlink in service_postinst(). Without this, the desktop icon won't appear or the app opens in a new browser tab instead of an embedded window.
app.tgz extraction path: fnOS extracts app.tgz to /vol*/@appcenter/<appname>/ (= $TRIM_APPDEST), NOT to /var/apps/.
TRIM_PKGVAR safety: The shared framework rejects TRIM_PKGVAR values that don't start with /vol.
manifest alignment: Key-value pairs use fixed-width alignment at column 16 with spaces (not tabs).
@ directories: When listing NAS volumes, filter out @-prefixed system directories (@appdata, @appcenter, etc.).
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub janstarzz/fnos-plugin-dev