Skip to content
Agentmart
Submit a tool

fc-nextjs-website

Build, package, and deploy a Next.js SSR/SSG app on function-compute's "nextjs" environment — Aliyun FC custom runtime (custom.debian10, Node.js 20), started…

Skill by Reyvic925

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/reyvic925-fc-nextjs-website

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Build, package, and deploy a Next.js SSR/SSG app on function-compute's "nextjs" environment — Aliyun FC custom runtime (custom.debian10, Node.js 20), started via `node /code/server.js` on port 9000. Use this when a user wants to host a Next.js app (App Router or Pages Router) on function-compute. Covers the `output: 'standalone'` build, the zip layout (server.js at the root), the platform-injected env vars, and the /functionCompute create + upload-to-LATEST API (a human publishes). 在 function-compute 的 "nextjs" 环境(阿里云 FC 自定义运行时 custom.debian10,Node.js 20,用 `node /code/server.js` 启动,监听 9000 端口)上 构建、打包并部署 Next.js SSR/SSG 应用。当用户需要在 function-compute 上托管 Next.js 应用时使用。涵盖 `output: 'standalone'` 构建、zip 结构(server.js 在根目录)、平台注入的 环境变量,以及创建函数与上传到 LATEST 的 API(发布由人工完成)。

Use cases: frontend, backend, devops

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/fc-nextjs-website

What's inside

Skill name
fc-nextjs-website
Description
Build, package, and deploy a Next.js SSR/SSG app on function-compute's "nextjs" environment — Aliyun FC custom runtime (custom.debian10, Node.js 20), started via `node /code/server.js` on port 9000. Use this when a user wants to host a Next.js app (App Router or Pages Router) on function-compute. Covers the `output: 'standalone'` build, the zip layout (server.js at the root), the platform-injected env vars, and the /functionCompute create + upload-to-LATEST API (a human publishes). 在 function-compute 的 "nextjs" 环境(阿里云 FC 自定义运行时 custom.debian10,Node.js 20,用 `node /code/server.js` 启动,监听 9000 端口)上 构建、打包并部署 Next.js SSR/SSG 应用。当用户需要在 function-compute 上托管 Next.js 应用时使用。涵盖 `output: 'standalone'` 构建、zip 结构(server.js 在根目录)、平台注入的 环境变量,以及创建函数与上传到 LATEST 的 API(发布由人工完成)。
License
MIT
Instructions
286 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (2)

  • .bundled-hash
  • SKILL.md

SKILL.md (first lines)

# Deploy a Next.js app on function-compute (nextjs)
# 在 function-compute 上部署 Next.js 应用(nextjs)

## AutoClaw managed-delivery boundary (highest priority) / 受控交付边界(最高优先级)

When `website_delivery_start` or `AUTOCLAW_FUNCTION_COMPUTE_WEBSITE_PROTOCOL`
is active, **do not call `/functionCompute`, read/request/store/output a JWT, or
execute this Skill's curl commands.** API sections are reference-only. Build,
package, and verify the artifact locally; AutoClaw Main owns create/upload, and
the human owns publication. The current managed automatic-preview path supports
nginx only, so do not add an nginx `autoPreview` marker for a Next.js package.

当 `website_delivery_start` 或 `AUTOCLAW_FUNCTION_COMPUTE_WEBSITE_PROTOCOL`
生效时,**禁止调用 `/functionCompute`、读取/索取/保存/输出 JWT,禁止执行本 Skill 的 curl。**
API 章节仅作参考;Agent 只负责本地构建、打包与验证,创建和上传由 AutoClaw Main 负责,
正式发布由用户负责。当前自动预览仅支持 nginx,Next.js 产物不得写 nginx `autoPreview` 标记。

## 1. What this environment is / 环境说明

**English.** The `nextjs` environment runs a **Next.js standalone server** on
Aliyun Function Compute's **custom runtime** (`runtime: custom.debian10`,
Debian 10, ships **Node.js 20** at `/var/fc/lang/nodejs20/bin`). Your uploaded
zip is extracted to **`/code`**, and the platform starts the app with a fixed
command that runs **`/code/server.js`** with the bundled Node.js 20. You deploy
a `next build` **`output: 'standalone'`** build, not raw source and not a
container image.

The platform starts the container with this fixed command (set by the platform
in `CustomRuntimeConfig` — the Agent does **not** set it):

```
/var/fc/lang/nodejs20/bin/node /code/server.js
```

So your zip **must** place `server.js` at its **root** (it becomes
`/code/server.js`, matching the command). The standalone `server.js` reads
`PORT` and `HOSTNAME` from the environment (the platform injects `9000` /
`0.0.0.0`), so **do not hardcode a port**.

A freshly-created function ships a **placeholder** `server.js` (a tiny built-in
`http` server that prints "upload your standalone build"). It runs until the
Agent uploads a real standalone build.

Fixed constraints (from the environment preset — do not fight these):

| Property / 属性 | Value / 值 |
|---|---|
| FC runtime | `custom.debian10` (Debian 10, bundled Node.js 20 at `/var/fc/lang/nodejs20/bin`) |
| Start command / 启动命令 | `/var/fc/lang/nodejs20/bin/node /code/server.js` (fixed by the platform) |
| Listen port / 监听端口 | **9000** (the app must listen on 9000; FC routes here) |
| Code root / 代码目录 | **`/code`** (your zip extracts here; `server.js` → `/code/server.js`) |
| Memory / 内存 | **1024 MB** |
| vCPU | **0.5** |
| Disk / 磁盘 | 512 MB |
| Timeout / 超时 | 60 s |
| Instance concurrency / 实例并发 | **5** |
| Filesystem / 文件系统 | On FC custom runtime the whole container is writable as root; `/code` holds the code |
| Injected env vars / 注入的环境变量 | `PORT=9000`, `HOSTNAME=0.0.0.0`, `NODE_ENV=production`, `PATH=/var/fc/lang/nodejs20/bin:/usr/local/bin:/usr/bin:/bin` |

**中文.** `nextjs` 环境在阿里云函数计算的**自定义运行时**
(`runtime: custom.debian10`,Debian 10,内置 **Node.js 20**,位于
`/var/fc/lang/nodejs20/bin`)上运行 **Next.js standalone 服务器**。你上传的 zip
会被解压到 **`/code`**,平台用固定命令以内置的 Node.js 20 运行 **`/code/server.js`**。
你部署的是 `next build` 的 **`output: 'standalone'`** 产物,而不是源码,也不是容器镜像。

平台在 `CustomRuntimeConfig` 中用固定命令启动容器(**由平台设置,Agent 不设置**):
`/var/fc/lang/nodejs20/bin/node /code/server.js`。因此你的 zip **必须**把
`server.js` 放在**根目录**(解压后为 `/code/server.js`,与启动命令匹配)。standalone
的 `server.js` 从环境变量读取 `PORT` 和 `HOSTNAME`(平台注入 `9000` / `0.0.0.0`),
所以**不要硬编码端口**。

新创建的函数自带一个**占位** `server.js`(一个用内置 `http` 模块写的小服务器,会打印
"upload your standalone build"),在 Agent 上传真正的 standalone 构建之前一直运行它。

平台注入的四个环境变量:`PORT=9000`、`HOSTNAME=0.0.0.0`、`NODE_ENV=production`、
`PATH=/var/fc/lang/nodejs20/bin:/usr/local/bin:/usr/bin:/bin`。

## 2. Build with `output: 'standalone'` / 使用 `output: 'standalone'` 构建

Next.js standalone mode produces a self-contained server: `next build` writes a
`server.js` plus a minimal `node_modules/` into `.next/standalone/`. Enable it
in `next.config.js`:

```js
// next.config.js
module.exports = {
  output: 'standalone',
};
```

Then build:

```bash
next build
```

This produces:

- `.next/standalone/` — a self-contained **`server.js`** + minimal
  **`node_modules/`** (this is the server you deploy).
- `.next/static/` — hashed static assets (JS/CSS chunks). **Not** copied into
  `standalone/` automatically — you must copy it in.
- `public/` — your static files (images, fonts, etc.). Also not copied
  automatically.

**中文.** Next.js 的 standalone 模式会产出一个自包含的服务器:`next build` 会在
`.next/standalone/` 中生成 **`server.js`** 和一份精简的 **`node_modules/`**。在
`next.config.js` 中启用 `output: 'standalone'`,然后执行 `next build`。注意
`.next/static/`(带哈希的静态资源)和 `public/`(你的静态文件)**不会**被自动复制到
`standalone/` 里,需要你手动复制进去。

## 3. The zip-layout contract / 文件结构约定

Your zip is extracted to `/code`. The **zip root** (not a nested folder) must
contain `server.js`, its `node_modules/`, and the static assets in the paths
Next.js expects — `.next/static` next to `server.js`, and `public` next to
`server.js`:

```

From Reyvic925/tradingwebsite, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 19, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Reyvic925

Cite this page

fc-nextjs-website skill. Agent Mart. https://agentmart.dev/skills/reyvic925-fc-nextjs-website (last updated 2026-10-24)