Communitygithub.com

SST(Serverless Stack)技能

协助在AWS上使用SST构建和部署全栈无服务器应用。适用于定义Lambda函数、API Gateway路由、DynamoDB表、S3存储桶,或部署支持SSR的Next.js/Remix/Astro应用。触发词:sst, serverless stack, sst dev, sst deploy, aws lambda, sst ion, resource linking。

SST(Serverless Stack)技能 是什么?

SST(Serverless Stack)是一个用于在AWS上构建和部署全栈应用的开源框架,提供Lambda、API Gateway、DynamoDB、S3以及前端框架(如Next.js、Remix、Astro)的高级结构化组件。该技能的核心优势在于其“实时本地开发”能力——通过`sst dev`命令,开发者可以在本地运行Lambda函数,同时连接真实AWS服务(DynamoDB、S3、SQS),实现热重载和VS Code断点调试,而无需频繁部署到云端。此外,SST引入类型安全的资源链接(`link`属性),自动生成最小权限IAM策略并注入环境变量,开发者只需在代码中通过`Resource.Name`访问链接资源,彻底告别硬编码表名或ARN。支持管理级联部署(`sst deploy --stage prod`)、PR预览环境(`sst deploy --stage pr-${PR_NUMBER}`)以及加密的分阶段密钥管理(`sst secret set`)。代码组织方面,建议将业务逻辑放在`packages/core/`中,处理函数(handlers)放在`packages/functions/`中,保持薄层。该技能适用于使用SST构建全栈无服务器应用的开发者,支持SST v2+(Ion架构),并覆盖从开发、测试到生产部署的完整生命周期。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/sst

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

SST

概述

SST(Serverless Stack)是一个用于在AWS上构建和部署全栈应用的框架,提供Lambda、API Gateway、DynamoDB、S3以及前端框架的高级结构化组件。它支持连接真实AWS服务的实时本地开发、类型安全的资源链接以及零配置TypeScript支持。

指令

  • 定义基础设施时,使用带有类型化组件的 sst.config.ts,例如 sst.aws.Function、sst.aws.Api、sst.aws.Bucket 和 sst.aws.Dynamo。
  • 连接资源时,在函数上使用 link 属性,以自动授予IAM权限并注入环境变量;在处理函数中通过 Resource.Name 访问链接的资源。
  • 本地开发时,使用 sst dev 命令,该命令会在本地运行Lambda并提供热重载功能,同时连接真实AWS服务(DynamoDB、S3、SQS),还支持VS Code断点调试。
  • 部署时,使用 sst deploy --stage prod 进行命名环境部署,使用 sst deploy --stage pr-${PR_NUMBER} 创建预览环境,使用 sst remove --stage dev 进行环境拆除。
  • 部署前端时,使用 sst.aws.Nextjs、sst.aws.Remix 或 sst.aws.Astro 组件,实现Lambda上的SSR渲染,静态资源存储在S3并由CloudFront分发。
  • 管理密钥时,使用 sst secret set KEY value 进行加密且与环境相关的密钥存储。
  • 组织代码时,保持处理函数(位于 packages/functions/)尽量薄,作为编排层,并将业务逻辑放在 packages/core/ 中。

示例

示例1:使用DynamoDB构建无服务器API

用户请求: "在AWS上使用SST创建一个带有DynamoDB的REST API"

操作步骤:

  1. 在 sst.config.ts 中定义DynamoDB表和API Gateway
  2. 将表链接到API处理函数,自动获取权限
  3. 实现CRUD处理函数,通过 Resource.MyTable.name 访问表
  4. 运行 sst dev 进行实时本地开发,连接真实AWS服务

输出结果: 一个具有类型安全资源访问和实时调试能力的无服务器REST API。

示例2:使用预览环境部署Next.js应用

用户请求: "在AWS上部署我的Next.js应用,并为每个PR创建预览环境"

操作步骤:

  1. 配置 sst.aws.Nextjs 组件,指定自定义域名并链接资源
  2. 配置CI流水线,为每个Pull Request运行 sst deploy --stage pr-${PR_NUMBER}
  3. 将后端资源(API、数据库)链接到Next.js部署
  4. 当PR关闭时,添加清理步骤:运行 sst remove

输出结果: 一个生产级Next.js部署在AWS上,每个PR都有独立的预览环境。

指南

  • 使用 link 而非手动编写IAM策略;SST会自动生成最小权限。
  • 在处理函数中通过 Resource.Name 访问链接资源;切勿硬编码表名或存储桶ARN。
  • 日常开发使用 sst dev;它比每次更改都部署到AWS快得多。
  • 为每个开发者创建独立的stage(例如 sst dev --stage alice),使每个人获得隔离的AWS资源。
  • 保持处理函数薄:业务逻辑放在 packages/core/,处理函数放在 packages/functions/。
  • 使用 sst secret 管理API密钥和凭证;它们会被加密且与环境相关。
  • 在CI中为每个Pull Request设置 sst deploy --stage pr-${PR_NUMBER},以创建预览环境。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- You are an expert in AG2 (formerly AutoGen), the open-source multi-agent conversation framework. You help developers build systems where multiple AI agents collaborate through structured conversations — with tool use, human-in-the-loop, code execution, group chat orchestration, and nested conversations — for complex tasks like software development, research, and data analysis.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

相关技能