Agent Skills › serverless/serverless › serverless-framework

serverless-framework

GitHub

基于 Serverless Framework 在 AWS 上构建、部署和运维无服务器应用,支持 Lambda、API Gateway 等服务,涵盖配置管理、本地调试及自动化部署流程。

skills/serverless-framework/SKILL.md serverless/serverless

Trigger Scenarios

用户提及 Serverless Framework 或 serverless.yml 执行 sls/deploy/invoke/logs 等命令 需要部署 Lambda 函数或配置 AWS 事件驱动工作流

Install

npx skills add serverless/serverless --skill serverless-framework -g -y
More Options

Use without installing

npx skills use serverless/serverless@serverless-framework

指定 Agent (Claude Code)

npx skills add serverless/serverless --skill serverless-framework -a claude-code -g -y

安装 repo 全部 skill

npx skills add serverless/serverless --all -g -y

预览 repo 内 skill

npx skills add serverless/serverless --list

SKILL.md

Frontmatter
{
    "name": "serverless-framework",
    "metadata": {
        "scope": "user",
        "author": "Serverless Inc.",
        "version": "2",
        "managed-by": "serverless-framework"
    },
    "description": "Builds, deploys, and operates applications on AWS with the Serverless Framework — serverless.yml configuration and the serverless\/sls CLI. Use whenever serverless.yml or serverless-compose.yml is present, the user runs or debugs any serverless\/sls command (deploy, dev, invoke, logs), mentions the Serverless Framework, or describes serverless work on AWS: Lambda functions, HTTP APIs, scheduled jobs, or event-driven workflows with any AWS service (API Gateway, S3, SQS, DynamoDB, and the rest)."
}

Serverless Framework

The Serverless Framework deploys applications to AWS from one serverless.yml: functions, the events that trigger them, and any other AWS resources they need, as one stack per stage.

Start here

  • In every project with a serverless.yml, run serverless agent setup in that directory, even when this skill is already installed. It adds the Framework's project skills (one per feature) to the project and reports sign-in, AWS credentials, and the service, with a fix for anything missing. Commit the project skills and keep them even when the service doesn't use a feature yet: each one loads only when a task involves its feature, including adding it.
  • Sort out sign-in with the user before the work that needs it: every command that builds or deploys needs it and AWS credentials (references/cli.md), serverless package included.
  • Give a database or other data store (DynamoDB, RDS, S3 buckets) its own service, deployed once to a shared stage; the app service reads its names and ARNs through ${param:...} (references/multi-service.md).
  • Develop a feature test-first on a personal stage, with serverless dev, unit tests, and integration tests against the deployed stage (references/development-workflow.md).
  • Don't answer from memory. serverless agent docs lists the documentation that ships with the installed CLI, matching its version and with no network needed; serverless agent docs <path> prints a page.

First deploy of a service

  1. serverless agent setup in the service directory.
  2. Sign-in and AWS credentials, resolved with the user.
  3. serverless package, which catches config and build errors before anything deploys. In a Compose project, deploy the services this one reads outputs from first (a data service, for example), then package it.
  4. serverless deploy --stage ${STAGE:-$USER}: the developer's own stage, not the shared dev (references/package-json-scripts.md). Use $USER only when it is their name. If their name differs, deploy with it and have them set STAGE; if you don't know it, or $USER is generic (root, ubuntu), ask.
  5. Verify with a real request to the endpoint, or serverless invoke and serverless logs.

Where to look

  • A new service; serverless.yml keys, events, IAM: references/serverless-yml.md.
  • A starting point to adapt, or a working service for a runtime, event, or integration: the Serverless Framework examples.
  • Extending the Framework past its built-in features (check serverless agent docs first): a plugin from the Serverless plugins, added with serverless plugin install --name <plugin>. The Framework builds JavaScript and TypeScript itself, so it needs no bundler plugin (serverless-esbuild, serverless-webpack, serverless-plugin-typescript), nor the plugins it now includes, such as serverless-python-requirements.
  • A database or other stateful resource, several services, values passed between services or stages, Compose, personal stages: references/multi-service.md, with references/package-json-scripts.md.
  • Adding or changing a feature (serverless dev, unit and integration tests): references/development-workflow.md.
  • Python functions (packaging dependencies, building for Lambda from macOS or Windows, the local loop): references/python.md.
  • Operating the CLI, credentials, CI/CD, troubleshooting: references/cli.md.
  • The agent commands (setup, docs, skills, inspect, the CLI's own MCP server serverless mcp, dev): references/agent-commands.md.
  • Upgrading from v1–v3, or cleaning up older v4 config: the serverless-upgrade skill.
  • Running the deployed stage's functions on this machine while developing, by a person or an agent (serverless dev, --detach, dev wait, dev stop): the serverless-dev-mode skill.
  • Hosting an MCP server on AWS: the serverless-mcp skill.
  • Untrusted, AI-generated, or per-session code in isolated compute: the serverless-sandboxes skill.

agent setup installs these four project skills into the project; where they are not installed, serverless agent skills read <name> prints them.

Gotchas

  • serverless with no arguments waits at an interactive template picker. Write serverless.yml yourself; a person at a terminal can run it to scaffold a project.
  • A project whose frameworkVersion pins v1–v3, or whose devDependencies list serverless v1–v3, cannot run agent setup or other v4 commands: set frameworkVersion: '4', remove the local copy (npm uninstall serverless), then run serverless agent setup and follow the serverless-upgrade skill.
  • serverless package checks the config and the build; checks against the AWS account, such as a resource name already taken, happen at deploy.
  • From a tool call, start serverless dev with --detach and --stage <you>, and end it with serverless dev stop, which restores the functions; when a session was killed, serverless dev restore --stage <you> does (the serverless-dev-mode skill).
  • When serverless login lists several orgs, ask which one the service belongs to and write org: into serverless.yml (references/cli.md).
  • A configuration change pushed with serverless deploy function stays after a later serverless deploy, which changes only what differs from the last template. Run serverless deploy function -f NAME again from the configuration you want.
  • An npm warn install-scripts line naming serverless during npm i -g serverless is harmless: the CLI downloads its binary on first run.

Version History

  • 7678c3e Current 2026-10-20 00:51

    新增功能:支持在本地机器上对已部署的函数运行真实调用测试。

  • bd2e5cc 2026-09-28 15:24

Same Skill Collection

skills/serverless-dev-mode/SKILL.md
skills/serverless-mcp/SKILL.md
skills/serverless-sandboxes/SKILL.md
skills/serverless-upgrade/SKILL.md

Metadata

Files
0
Version
7678c3e
Hash
120ffbde
Indexed
2026-09-28 15:24

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 15:23
浙ICP备14020137号-1