artubss/skills-claude-code/tpl-backend-serverless-lambda
Claude Code and agent skill by artubss/skills-claude-code
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Template do pack (backend/06-serverless-lambda.md). Orienta o agente em APIs, servicos e arquitetura backend alinhado a esse contexto.
Install
npx vskill@latest install artubss/skills-claude-code/tpl-backend-serverless-lambdaSKILL.md
The same SKILL.md was published earlier as artubss/skills-claude-code/tpl-backend-serverless-lambda.
PROJECT: Serverless API (AWS Lambda + TypeScript)
Skill gerado a partir do pack templates-claude-code. Arquivo de origem: backend/06-serverless-lambda.md. Use como baseline e adapte ao projeto antes de mudancas grandes.
Conteudo do template
STACK
| Technology | Version | Purpose | |
|---|---|---|---|
| Node.js | 22.x (Lambda) | Runtime | |
| TypeScript | 5.4+ | Language | |
| SST | v3 | Infrastructure as code + local dev | |
| AWS Lambda | — | Compute | |
| API Gateway v2 (HTTP) | — | HTTP trigger | |
| DynamoDB | — | Primary database | |
| AWS SDK v3 | 3.x | DynamoDB DocumentClient | |
| Zod | 3.x | Input validation | |
| AWS Lambda Powertools | 2.x | Logger, Tracer, Metrics middleware | |
| Jest | 29.x | Unit tests | |
| esbuild | — | Bundler (via SST) |
PROJECT STRUCTURE
ARCHITECTURE RULES
- Handler → Service → Repository — strictly enforced even in Lambda
- Each Lambda handler is ONE file with ONE exported
handlerfunction - Handler files: import middleware, validate input, call service, return response helper
- Services contain business logic — no AWS SDK imports
- Repositories contain ALL DynamoDB access — no business logic
- Use Powertools middleware for every handler (structured logging, tracing, error handling)
- Never import the entire AWS SDK — always use specific clients:
@aws-sdk/client-dynamodb - Shared code lives in
packages/core/(separate SST package) to avoid duplicating across lambdas
LAMBDA RULES
Cold Start Optimization
Bundle Size Rules
- Target < 1MB per function (unzipped)
- Use
esbuildtree-shaking — import only what you need from AWS SDK v3 - Mark
aws-sdkas external in bundler (provided by Lambda runtime) - Do NOT bundle fonts, images, or data files — use S3 or DynamoDB
- Run
sst analyzeto check bundle sizes before deploy
Powertools Middleware Pattern
Standard Response Helpers
IAM Least Privilege — SST Stack
Environment Variables
- All secrets via SST Secrets (backed by SSM Parameter Store) — never in env vars directly
- Access:
Resource.JwtSecret.valuein SST v3 (type-safe binding) - Non-secret config: SST
environmentobject (becomes Lambda env var)
ROUTING TABLE
| Trigger | Method | Route | Auth | Handler | |
|---|---|---|---|---|---|
| Register | POST | /users/register | Public | handlers/auth/register.handler | |
| Login | POST | /auth/login | Public | handlers/auth/login.handler | |
| Refresh token | POST | /auth/refresh | Refresh token | handlers/auth/refresh.handler | |
| Get user | GET | /users/{id} | Bearer JWT | handlers/users/get.handler | |
| List users | GET | /users | Bearer + Admin | handlers/users/list.handler | |
| Create user | POST | /users | Bearer + Admin | handlers/users/create.handler | |
| Update user | PATCH | /users/{id} | Bearer + Admin | handlers/users/update.handler | |
| Delete user | DELETE | /users/{id} | Bearer + Admin | handlers/users/delete.handler | |
| Health | GET | /health | Public | handlers/health.handler |
QUALITY GATES
Before deploying, verify ALL of the following:
- [ ]
npx tsc --noEmitpasses across all packages - [ ]
jest --runInBandpasses (Lambda tests often can't run in parallel) - [ ] Bundle size < 1MB per function:
sst analyze - [ ] No hardcoded secrets — all via
sst.Secretor environment vars - [ ] Each function's IAM permissions are minimal (least privilege)
- [ ]
logger.info/warn/errorused (notconsole.log) for structured logs - [ ] X-Ray tracing enabled via Powertools tracer
- [ ] Environment variable access validated at startup (Zod parse of
process.env) - [ ] DynamoDB client initialized outside handler (module scope)
- [ ] Error responses use helper functions (
badRequest,internalError) — no manualstatusCode
FORBIDDEN
- NEVER use
AdministratorAccessIAM policy — define specific actions + resources - NEVER store secrets as plaintext Lambda environment variables — use SST Secrets → SSM
- NEVER initialize AWS clients inside the handler function — only at module scope
- NEVER
console.login handlers — use PowertoolsLogger - NEVER bundle test files into the Lambda package
- NEVER use
@aws-sdk/client-dynamodbdirectly in handlers — go through repository layer - NEVER return raw AWS SDK error messages to clients — map to user-friendly messages
- NEVER use memory > 1792MB without benchmarking (cost increases, not always faster)
- NEVER set Lambda timeout > 30s for API endpoints (API Gateway max is 29s)
- NEVER mix SST v2 and v3 APIs — they are incompatible
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfavorites/tpl-backend-serverless-lambda/SKILL.md
Popularity
- Repository stars
- 12
- Repository forks
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/artubss/skills-claude-code/tpl-backend-serverless-lambda)