Skip to content
Agentmart
Submit a tool

fossyl-route

Use when defining route handlers in a fossyl project — builder chain, handler curry signatures, authWrapper/bodyWrapper, route-service composition

Skill by YoyoSaur

IndexedGPL-3.0
Write a review

Chalk Labs

Need help deploying fossyl-route?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/yoyosaur-fossyl-route

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when defining route handlers in a fossyl project — builder chain, handler curry signatures, authWrapper/bodyWrapper, route-service composition

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/fossyl-route

What's inside

Skill name
fossyl-route
Description
Use when defining route handlers in a fossyl project — builder chain, handler curry signatures, authWrapper/bodyWrapper, route-service composition
License
GPL-3.0
Compatibility
opencode
Metadata
audience: fossyl-user
Instructions
173 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# fossyl-route

## Overview

Routes use a typed builder chain. Every chain step is optional — the type system enforces the correct handler signature based on which steps are used.

Routes compose services freely. A single route handler may call multiple services.

## Pattern: createRouter + Per-Endpoint createEndpoint

A `createRouter(path)` provides a path prefix. Each export calls `router.createEndpoint(...)` with the full chain, keeping every endpoint self-contained:

```typescript
import { createRouter } from "@fossyl/core";
import { authenticator } from "../../auth";
import * as todosService from "../services/todos.service";
import { listTodoQueryValidator, createTodoValidator, updateTodoValidator } from "../validators/todos.validators";

const router = createRouter("/todos");

export const listTodos = router
  .createEndpoint("/todos")
  .authenticator(authenticator)
  .query(listTodoQueryValidator)
  .paginate({ defaultPageSize: 20, maxPageSize: 100 })
  .get((params) => async () => {
    const result = await todosService.listTodos(
      params.auth.userId,
      params.pagination,
      { done: params.query.done as boolean | undefined }
    );
    return {
      typeName: "TodoList",
      data: result.data,
      pagination: result.pagination,
    };
  });

export const getTodo = router
  .createEndpoint("/todos/:id")
  .authenticator(authenticator)
  .get((params) => async () => {
    const todo = await todosService.getTodo(params.url.id, params.auth.userId);
    return { typeName: "Todo", ...todo };
  });

export const createTodo = router
  .createEndpoint("/todos")
  .authenticator(authenticator)
  .validator(createTodoValidator)
  .post((_params) => (auth) => (body) => async () => {
    const todo = await todosService.createTodo(body.title, body.due_date, auth.userId);
    return { typeName: "Todo", ...todo };
  });

export const updateTodo = router
  .createEndpoint("/todos/:id")
  .authenticator(authenticator)
  .validator(updateTodoValidator)
  .put((params) => (auth) => (body) => async () => {
    const todo = await todosService.updateTodo(params.url.id, body, auth.userId);
    return { typeName: "Todo", ...todo };
  });
```

Each `export const` is a complete route definition — no hidden shared middleware.

**Why per-endpoint chains?** From an AI agent's perspective, this is the right trade-off. A single export shows the entire chain so the handler signature, params shape, and disabled middleware are immediately visible without cross-referencing. The `createRouter` is just a path prefix convenience.

## Builder Chain

```typescript
createEndpoint("/todos")
  .query(queryValidator)       // optional — validates + types query params
  .paginate({ pageSize: 20 })  // optional — adds pagination to params + response
  .authenticator(authFn)       // optional — adds auth layer
  .validator(bodyValidator)    // optional — validates request body
  .get(handler)                // terminal: get | post | put | delete
```

**Order is enforced by the type system.** Each step returns a different router type exposing only valid next methods:

| Step | Returns | Next methods |
|---|---|---|
| `createEndpoint(path)` | `Endpoint` | `.query()` |
| `.query(v)` | `QueryableRouter` | `.paginate()`, `.authenticator()` |
| `.paginate(c)` | `PaginatedRouter` | `.authenticator()` |
| `.authenticator(f)` | `AuthenticatedRouter` | `.validator()` (if body allowed), terminal |
| `.validator(f)` | `ValidatedRouter` | terminal |
| Terminal `.get/post/put/delete(h)` | `void` (registers the route) | — |

## Handler Curry Signatures

The handler is a curried function. Each layer (params, auth, body) is a synchronous function that returns the next layer. Only the innermost `() => Promise<Response>` is `async`.

```
(params?) => (auth?) => (body?) => async () => Promise<Response>
```

**When `.validator()` is used**, the curry expands to separate auth/body layers for type safety. When no validator is used, everything accumulates into a single params layer.

| Chain Layers | Handler Signature |
|---|---|
| none | `async () => ({...})` |
| params only | `(params) => async () => ({...})` |
| auth only | `(params) => async () => ({...})` — `params.auth` is available |
| params + auth | `(params) => async () => ({...})` — `params.auth` is available |
| body only | `(body) => async () => ({...})` |
| params + body | `(params) => async () => ({...})` — `params.body` is available |
| auth + body | `(_params) => (auth) => (body) => async () => ({...})` |
| params + auth + body | `(params) => (auth) => (body) => async () => ({...})` |

- `params` includes `url: { ... }` for path params, `query: { ... }` if `.query()` is used, and `pagination: { ... }` if `.paginate()` is used
- `auth` type is whatever your `authWrapper` returns
- `body` type is whatever your `bodyWrapper` validates against
- Use `_params` when the params layer exists but is unused

## authWrapper

From YoyoSaur/fossyl, GPL-3.0.

More from YoyoSaur/fossyl

Signals

Stars
0
Forks
1
Open issues
18
Last commit (this folder)
Jun 9, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from YoyoSaur

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get fossyl-route running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying fossyl-route?

CallGet help
Cite this page

fossyl-route skill. Agent Mart. https://agentmart.dev/skills/yoyosaur-fossyl-route (last updated 2026-10-24)