CtrlK
BlogDocsLog inGet started
Tessl Logo

pubnub/pubnub-functions

Create, configure, and deploy PubNub Functions 2.0 event handlers, triggers, and serverless endpoints. Use when building real-time message transformations, PubNub modules, webhook integrations, or edge data processing.

Does it follow best practices?

Evaluation98%

1.81x

Agent success when using this tile

Validation for skill structure

Overview
Skills
Evals
Files

rubric.jsonevals/scenario-2/

{
  "context": "Tests whether the agent correctly implements an On Request PubNub Function as an HTTP REST API, using the correct function signature, CORS handling, response methods, and proper async patterns with KVStore.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Request-response signature",
      "description": "Function signature takes both request and response parameters: (request, response)",
      "max_score": 10
    },
    {
      "name": "Response.send usage",
      "description": "Uses response.send(body, statusCode) to return HTTP responses with appropriate status codes",
      "max_score": 8
    },
    {
      "name": "CORS Allow-Origin header",
      "description": "Sets Access-Control-Allow-Origin header on the response (e.g., response.headers['Access-Control-Allow-Origin'] = '*')",
      "max_score": 10
    },
    {
      "name": "CORS Allow-Methods header",
      "description": "Sets Access-Control-Allow-Methods header listing the supported HTTP methods",
      "max_score": 8
    },
    {
      "name": "OPTIONS preflight handling",
      "description": "Handles OPTIONS method requests for CORS preflight, returning a 200 response",
      "max_score": 10
    },
    {
      "name": "Default async export",
      "description": "Function uses 'export default async' syntax",
      "max_score": 8
    },
    {
      "name": "Try/catch wrapping",
      "description": "Main logic is wrapped in a try/catch block with an error response in the catch",
      "max_score": 8
    },
    {
      "name": "Async/await not then",
      "description": "Uses async/await for asynchronous operations, does NOT use .then() or .catch() chains",
      "max_score": 10
    },
    {
      "name": "KVStore require inside body",
      "description": "Imports kvstore using require('kvstore') inside the function body, not at the file level",
      "max_score": 8
    },
    {
      "name": "KVStore TTL in minutes",
      "description": "If db.set() is called with a TTL, the value is in minutes (e.g., 1440 for 24 hours, 43200 for 30 days), not seconds or milliseconds",
      "max_score": 10
    },
    {
      "name": "Error status 500 response",
      "description": "Returns a 500 status code in the catch block for internal server errors",
      "max_score": 5
    },
    {
      "name": "On Request trigger type",
      "description": "Deployment instructions identify the function trigger type as 'On Request' (HTTP endpoint)",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i pubnub/pubnub-functions@0.2.2

evals

SKILL.md

tile.json