Back to Skills

workers-runtime-validator

verified

Automatically validates Cloudflare Workers runtime compatibility during development, preventing Node.js API usage and ensuring proper Workers patterns

View on GitHub

Marketplace

hirefrank-marketplace

hirefrank/hirefrank-marketplace

Plugin

edge-stack

development

Repository

hirefrank/hirefrank-marketplace
2stars

plugins/edge-stack/skills/workers-runtime-validator/SKILL.md

Last Verified

January 16, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/hirefrank/hirefrank-marketplace/blob/main/plugins/edge-stack/skills/workers-runtime-validator/SKILL.md -a claude-code --skill workers-runtime-validator

Installation paths:

Claude
.claude/skills/workers-runtime-validator/
Powered by add-skill CLI

Instructions

# Workers Runtime Validator SKILL

## Activation Patterns

This SKILL automatically activates when:
- New `.ts` or `.js` files are created in Workers projects
- Import statements are added or modified
- Code changes include potential runtime violations
- Before deployment commands are executed
- When `process.env`, `require()`, or Node.js APIs are detected

## Expertise Provided

### Runtime Compatibility Validation
- **Forbidden API Detection**: Identifies Node.js built-ins that don't exist in Workers
- **Environment Access**: Ensures proper `env` parameter usage vs `process.env`
- **Module System**: Validates ES modules usage (no `require()`)
- **Async Patterns**: Ensures all I/O operations are async
- **Package Compatibility**: Checks npm packages for Node.js dependencies

### Specific Checks Performed

#### ❌ Critical Violations (Will Break in Production)
```typescript
// These patterns trigger immediate alerts:
import fs from 'fs';                    // Node.js API
import { Buffer } from 'buffer';        // Node.js API
const secret = process.env.API_KEY;     // process doesn't exist
const data = require('./module');        // require() not supported
```

#### ✅ Correct Workers Patterns
```typescript
// These patterns are validated as correct:
import { z } from 'zod';                // Web-compatible package
const secret = env.API_KEY;             // Proper env parameter
const hash = await crypto.subtle.digest(); // Web Crypto API
```

## Integration Points

### Complementary to Existing Components
- **workers-runtime-guardian agent**: Handles deep runtime analysis, SKILL provides immediate validation
- **es-deploy command**: SKILL prevents deployment failures by catching issues early
- **validate command**: SKILL provides continuous validation between explicit checks

### Escalation Triggers
- Complex runtime compatibility questions → `workers-runtime-guardian` agent
- Package dependency analysis → `edge-performance-oracle` agent
- Migration from Node.js to Wor

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4894 chars