/tsh-stack-serverless:configuring-serverless-servicefrom TSH Stack: Serverless
Defines AWS Lambda service configuration on OSLS/Serverless Framework: project structure, IAM least-privilege, reserved concurrency, VPC attachment, secrets, and CloudFormation template assertions. Use when creating or editing serverless.ts, adding functions, or choosing dependencies.
Ships in TSH Stack: Serverless. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Owns the deployable service definition: service and stage configuration,
per-function definitions, the execution role, reserved concurrency, VPC
attachment, secrets, and what to assert over the packaged CloudFormation
template. It does not own what happens inside a handler — that is
implementing-lambda-functions —
nor the compiler and bundler that produce the deployed artifact — that is
configuring-typescript-for-serverless.
Read the project's existing serverless.ts and config/ (or equivalent)
before proposing anything. Local conventions and an existing account topology
outrank this skill's defaults; apply this guidance where the project is silent,
and in a repository that has nothing yet it is the convention to build to.
This skill targets AWS Lambda through OSLS v4 or Serverless Framework v3,
Node.js 24 (nodejs24.x on arm64; nodejs22.x stays in range until its
2027-04-30 deprecation, never for a new service). The two frameworks are not equals: a new service installs OSLS —
"serverless": "npm:osls@^4" — never Serverless Framework v3. v3 reached end
of life at the close of 2024: no security fixes, a runtime schema and type
package that stop at nodejs20.x, and AWS SDK v2 pinned underneath. It stays
in range so an existing v3 project still gets this guidance, not so a new one
starts on it. Before applying anything here, read the project's package.json
for the installed serverless or osls major and engine range. Outside that
range — Serverless Framework v4 is a different product line, with its own
licensing and a built-in bundler — stop and say so rather than applying this
skill's guidance as if it still applied.
| Severity | Rule |
|---|---|
| NEVER | Put a secret value in a function's environment. The value is stored verbatim in the CloudFormation template and readable by anyone who can read the stack or call lambda:GetFunctionConfiguration. Pass an identifier instead, and resolve the value at runtime from a secrets store. |
| NEVER | Write an IAM statement with Resource: "*" or a wildcard Action. Scope every statement to this service. The exception is the narrow, named set of actions AWS itself defines no resource type for — X-Ray's write actions, CloudWatch Logs' delivery actions, and the ENI actions Lambda needs for VPC attachment — list those explicitly with the reason, never match them with a pattern. Without that carve-out the rule reads as unsatisfiable and gets abandoned outright. |
| MUST | Give every deployed function its own reservedConcurrency. A function without one draws on the account's unreserved pool, so one endpoint under load starves every other function in the account — and, for anything database-backed, can open more connections than the pool budget assumes. |
| NEVER | Reference a CloudFormation resource by a logical id you wrote by hand. Derive it with the framework's own rule (non-alphanumeric characters replaced, first character upper-cased). A hand-written id packages cleanly and fails minutes into a deploy with an unresolved reference. |
| Reference | Load when | Covers |
|---|---|---|
| Service and stage configuration | Editing provider-level config, stages, environment defaults, the health endpoint, access logs or throttling | Stage derivation, timeouts, tags, per-stage environment values, the health endpoint contract, access logging, stage throttling, tracing, the pipeline contract |
| IAM and secrets | Writing or reviewing an IAM statement, or passing a secret to a function | Least-privilege statement shape, the wildcard carve-out, secret containers vs secret values |
| Concurrency and VPC | Setting reservedConcurrency, or deciding whether a function needs a VPC | The starvation and connection-budget argument, VPC as opt-in and its cost |
| Packaging and template checks | Adding or reviewing a check that runs against the packaged template | What to assert over the packaged CloudFormation template, and why packaging time is the last cheap moment to catch it |
| Library policy | Choosing or reviewing any dependency, pinning a version, or hitting a choice the team has not settled | What TSH uses, what it avoids and why, the two open questions, resolving versions from the registry, the lint and commit toolchain |
| Project structure | Laying out a service, adding a file, or reviewing where something was put | How a TSH serverless service is shaped and what each file is responsible for |
| Local development | Setting up or fixing how the service runs on a developer's machine | serverless-offline as dependency and plugin, the local stage, .env.dist, a local database |
| Step Functions workflows | The service orchestrates anything, adding a task to a state machine, or a task's error must be caught by the state machine | One function per task, Retry and Catch in the state machine, TimeoutSeconds below the function timeout, error names as string literals |
Step 1 — Read the ground truth. The service definition, config/, and the
packaged template from the last successful package if one exists. Note which
execution role each function uses and which stage names actually deploy. In a
repository with none of that yet, read
project-structure.md and
library-policy.md instead — they are the
conventions a new service follows, and following them is what makes the result
look like every other TSH serverless service.
Step 2 — Load what the work touches. Choosing a dependency →
library-policy.md. Adding a function →
service-and-stage-configuration.md
and concurrency-and-vpc.md. A new
permission or secret → iam-and-secrets.md.
A state machine task →
step-functions-workflows.md.
Running it on a developer machine →
local-development.md.
Step 3 — Apply the rules. Every function declares reservedConcurrency and
an execution role built from scoped statements; a secret is a container plus an
identifier, never a value; a CloudFormation reference is derived, never typed by
hand; an HTTP service has a health endpoint that answers only ok or
unavailable; every real repository has an integration test against the local
database.
Step 4 — Package and check. Package for the target stage and run the
assertions from
packaging-and-template-checks.md,
including executing the packaged artifact. Work that packages but fails a check
is not done.
On a choice the team has not settled — the greenfield ORM, the test runner —
ask rather than pick: in the main conversation with AskUserQuestion, as a
subagent by reporting the blocker to the caller. See
library-policy.md.
Review the packaged template, not only the diff — plugins generate roles and
resources the diff never shows. Apply the four Non-negotiable Rules to every role
and function in it, check each state machine task's TimeoutSeconds against its
function's timeout, and report findings by severity with the reference that owns
each violated rule.
implementing-lambda-functions —
the handler code that runs inside a function this skill defines.configuring-typescript-for-serverless —
the compiler and bundler that produce the artifact this skill packages and
deploys; owns the full bundler-and-ORM pairing reasoning.references/concurrency-and-vpc.md (opens in a new tab)references/iam-and-secrets.md (opens in a new tab)references/library-policy.md (opens in a new tab)references/local-development.md (opens in a new tab)references/packaging-and-template-checks.md (opens in a new tab)references/project-structure.md (opens in a new tab)references/service-and-stage-configuration.md (opens in a new tab)references/step-functions-workflows.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Trigger on: starting or changing an OSLS service, editing serverless.ts, adding a function definition, choosing an ORM, bundler, test runner or any dependency for a serverless service, laying out a serverless project, scoping an IAM statement for a Lambda execution role, setting reservedConcurrency, attaching a function to a VPC, passing a secret to a function, naming CloudFormation resources, or checking a packaged template before deploying.
Three short reads, in order
serverless, aws-lambda, osls, iam, cloudformation, infrastructure-as-code
3 skills in this plugin
/configuring-typescript-for-serverlessConfigures TypeScript for AWS Lambda services bundled by Serverless Framework or OSLS: which Node runtime and TypeScript version to target, the ESM tsconfig baseline for bundler-emitted handler code, and choosing between esbuild and webpack with ts-loader. Use when starting a Lambda service, editing a serverless project's tsconfig, or diagnosing a bundle that compiles but fails at runtime./implementing-lambda-functionsImplements and reviews AWS Lambda handlers in TypeScript: the thin-handler and pure-service split, middleware chain ordering, schema validation at the event boundary, the error hierarchy that maps to HTTP responses, structured logging with the request id, and what belongs in the init phase. Use when writing a Lambda handler, adding an endpoint, or reviewing a serverless function change.npx claudepluginhub thesoftwarehouse/agentic-collections --plugin tsh-stack-serverlessOther plugins' skills for the same job