Agent skill
libweb
libweb - Web extension utilities. authMiddleware validates JWT tokens. corsMiddleware handles cross-origin requests. validationMiddleware validates request bodies against JSON schema. createAuthMiddleware, createCorsMiddleware, createValidation are factories for customization. Use for securing HTTP APIs, request validation, and CORS handling with Hono framework.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/libweb
SKILL.md
libweb Skill
When to Use
- Adding authentication to HTTP endpoints
- Configuring CORS for API access
- Validating request payloads
- Building secure REST APIs with Hono
Key Concepts
authMiddleware: Validates JWT tokens from Authorization header.
corsMiddleware: Handles preflight requests and CORS headers.
validationMiddleware: Validates request body against JSON schema.
Usage Patterns
Pattern 1: Secure endpoint
import { authMiddleware, corsMiddleware } from "@copilot-ld/libweb";
app.use(corsMiddleware({ origins: ["http://localhost:3000"] }));
app.use("/api/*", authMiddleware(authConfig));
Pattern 2: Validate requests
import { validationMiddleware } from "@copilot-ld/libweb";
const schema = {
type: "object",
required: ["message"],
properties: { message: { type: "string", maxLength: 1000 } },
};
app.post("/api/chat", validationMiddleware(schema), handler);
Integration
Used by Web and API extensions. Works with Hono framework middleware pattern.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?