Skip to content
Back to skills

Code Quality Andreacadonna

ASecurity

Node.js code quality standards for the serverless function runtime. Use when writing, reviewing, or refactoring JavaScript/TypeScript code.

  • 57 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 17, 2026
code-qualityjavascripttypescriptjavanodetestingrefactoringapi

Works with

  • api

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill code-quality-andreacadonna --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Quality Andreacadonna?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Quality Andreacadonna
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-code-quality-andreacadonna/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-code-quality-andreacadonna)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-quality
description: Node.js code quality standards for the serverless function runtime. Use when writing, reviewing, or refactoring JavaScript/TypeScript code.
---

# Code Quality — Skill

## Purpose

Maintain consistent, spec-compliant code throughout the serverless function runtime implementation.

## When to Use

- Writing new source files
- Reviewing or refactoring existing code
- Making implementation decisions about structure or patterns

## Language and Runtime Conventions

1. **Node.js with modern JavaScript or TypeScript.** Use ES modules (`import`/`export`).
2. **Web-standard `Request`/`Response`** for the handler contract. Use the global `Request` and `Response` objects (Node.js 18+ built-in) or a minimal polyfill.
3. **Minimal dependencies.** Do not add frameworks or libraries unless strictly required by the spec. Prefer Node.js built-ins.
4. **No TypeScript compilation complexity.** If using TypeScript, keep the build step simple. Plain JavaScript is acceptable.

## Code Structure Conventions

1. **One module, one responsibility.** Each file should have a clear, single purpose.
2. **Named exports for public API.** Default exports only for handler method functions.
3. **Handler functions are named by HTTP method**: `export function GET(request) {}`, `export function POST(request) {}`.
4. **No global mutable state** except where explicitly required by the spec (warm module reuse via module-level variables is allowed per REQ-RTG-006).

## Error Handling Conventions

1. **Runtime errors use the spec's JSON format**: `{"errorCode": "<CODE>", "message": "<detail>"}`.
2. **Error codes are exactly**: `ROUTE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `HANDLER_EXCEPTION`, `INVALID_HANDLER_RESPONSE`, `INVOCATION_TIMEOUT`.
3. **HTTP status mapping is fixed**: 404, 405, 500, 500, 504 respectively.
4. **Handler exceptions must be caught** and mapped to `HANDLER_EXCEPTION` with the original error message.
5. **Timeout enforcement uses AbortController or equivalent** — do not rely on unref'd timers alone.

## Testing Conventions

1. **E2E tests run via `npm test`** (REQ-RCV-006).
2. **Tests start the runtime, send HTTP requests, and assert responses.** No mocking of the runtime itself.
3. **Each spec scenario (Section 6) maps to at least one test case.**
4. **Test exit code 0 on success** (REQ-RCV-007).

## Quality Checklist

- [ ] All source files use ES modules
- [ ] Handler contract uses Web-standard Request/Response
- [ ] No unnecessary dependencies added
- [ ] Error responses match spec JSON format exactly
- [ ] Timeout enforcement is 3000ms per invocation
- [ ] No debug prints or commented-out code in committed files
- [ ] Each file has a single, clear responsibility

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.