lambdakit-ts
SKILL.md
LambdaKit TS
Bootstrap a new TypeScript AWS Lambda using the instructions below.
If the desired event source is not specified, create a Lambda with API Gateway as the event source.
Start with:
- If a name is not specified, generate an interactive prompt and ask the user what
what should the lambda be called?, and pre-populate it with the name of the current directory in kebab-case. - Before proceeding further, present the user with an interactive prompt:
The Lambda will be created at ${path}. Please confirmThen give the user 2 options:- Yes — proceed with creating the Lambda at this path
- Enter a directory name — a new subdirectory with this name will be created in the current directory If a new directory name is entered, use this value in kebab-case, and create the lambda in the new directory.
- create package.json with
npm init -y - install dev dependencies
npm install -D @types/aws-lambda @types/node esbuild typescript prettier eslint eslint-plugin-prettier eslint-plugin-check-file eslint-config-prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin - install runtime dependencies
npm install @aws-lambda-powertools/logger @middy/core - run
mkdir -p src/functions src/interfacesto create the directories - copy the provided
assets/tsconfig.jsonfile - copy the provided
assets/eslint.config.mjsfile - copy the provided
assets/index.tsfile and change theserviceNamevalue according to the provided name or directory name - copy the provided
assets/local-invoke.tsfile and change thefunctionNamevalue according to the provided name or directory name - copy the provided
assets/greet.tsfile and copy it to thesrc/functions/directory - copy the provided
build.shfile and runchmod + xto assign execute permissions - copy the provided
.prettierrcfile - copy the provided
.gitignorefile - add scripts to
package.jsonfrom the sectionadd package.json scriptsbelow - when done, add instructions to the output as per the
Final Instructionssection below
Code Organization Principles
add package.json scripts
add the following scripts in package.json:
{
"scripts": {
"typecheck": "tsc --noEmit",
"build": "bash build.sh",
"invoke:local": "npx tsx src/local-invoke.ts",
"prettier": "prettier --check '**/*.{ts,json}'",
"prettier:fix": "prettier --write '**/*.{ts,json}'",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix"
}
}
Final Instructions
- To build the project, run
npm run build - To autoformat using prettier, run
npm run prettier:fix - To autofix lint issues, run
npm run lint:fix
Best Practices
- Use async/await syntax instead of promises
- Use import statements instead of require where possible
- Use aliased imports as defined in
tsconfig.json - Use Middy middleware for cross-cutting concerns
- Use AWS Lambda Powertools for structured logging
- Always include proper error handling with appropriate logging
- When creating other functions, pass the instance of the logger to those functions so that the context and properties can be persisted across logs
- Use the Single Responsibility Principle (SRP) to rnsure good separation of concerns.
- SRP: Ensure a single export per file
- SRP: Always create separate files for functions and store functions in
src/functions - SRP: Prefer interfaces over types and store interfaces in
src/interfaces
Weekly Installs
2
Repository
thecarlo/carlo-…ketplaceGitHub Stars
1
First Seen
Feb 9, 2026
Security Audits
Installed on
mcpjam2
claude-code2
replit2
junie2
windsurf2
zencoder2