Agent skill

Koapp Typescript

by AxiosLeo in AxiosLeo/node-koapp

Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares…

MITAuto-check passedBackend & APIs

Install Koapp Typescript

skills CLI
$ npx skills add AxiosLeo/node-koapp --skill koapp-typescript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AxiosLeo/node-koapp koapp-typescript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AxiosLeo/node-koapp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/assets/skills/koapp-typescript .claude/skills/koapp-typescript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
koapp-typescript
GitHub stars
145
Token cost
~2.6k tokens
SKILL.md length
629 words
Files
2
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares…

  • A koapp project uses TypeScript
  • SKILL.md covers Setup, Importable symbols, Typing contexts: pick the… and Three levels of Router generics, plus 7 more sections
  • Calls npm
  • Typing context.params/body/query

What it does

Koapp Typescript is an agent skill from AxiosLeo/node-koapp. Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares, module augmentation, typed file uploads with @koa/multer, response helper generics, and typed application configs. Use when a koapp project uses TypeScript, when typing context.params/body/query, annotating route handlers or controllers, typing uploaded files, or importing types from @axiosleo/koapp.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `examples.md`).

It sits in Backend & APIs, covering Type safety and File uploads and storage. It works with TypeScript. The repository describes itself as: About Design for quickly developing OpenAPI applications using Node.js. The licence is MIT.

When your agent uses it

  • A koapp project uses TypeScript
  • Typing context.params/body/query
  • Annotating route handlers
  • Typing uploaded files

Example prompts

  • “/koapp-typescript”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 102955d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Koapp Typescript loads about 2.6k tokens when it runs. Until then it costs about 128 tokens; SKILL.md has 629 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~128
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AxiosLeo/node-koapp at commit 102955d, republished under its MIT licence (© AxiosLeo). 629 words, ~2,592 tokens.

Download SKILL.mdSave it as .claude/skills/koapp-typescript/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
koapp-typescript
description
Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares, module augmentation, typed file uploads with @koa/multer, response helper generics, and typed application configs. Use when a koapp project uses TypeScript, when typing context.params/body/query, annotating route handlers or controllers, typing uploaded files, or importing types from @axiosleo/koapp.

@axiosleo/koapp in TypeScript

Source of truth: index.d.ts at the package root.

The framework ships a full generic type system. This skill covers what is importable, how to type contexts and handlers, and the recipes for cases the generics do not cover directly (file uploads, extending the context).

Setup

bash
npm install -D typescript @types/koa @types/node
# for file uploads:
npm install @koa/multer && npm install -D @types/koa__multer

@types/koa must be a direct devDependency: index.d.ts and @types/koa__multer both resolve koa types, and they must land on the same installed copy for context.koa typing and the multer module augmentation to line up.

Importable symbols

All of these come straight from import { ... } from '@axiosleo/koapp':

CategorySymbols
ClassesKoaApplication, SocketApplication, WebSocketApplication, Application, Router, Controller, Model, HttpResponse, HttpError, SocketClient
Context typesKoaContext, AppContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext, ContextDataSpec, ContextHandler
Router typesRouterOptions, RouterInfo, RouterValidator, ValidatorConfig, HttpMethod
Config typesAppConfiguration, TypedAppConfiguration, KoaApplicationConfig, TypedKoaApplicationConfig, SocketAppConfiguration, TypedSocketAppConfiguration, WebSocketAppConfiguration, TypedWebSocketAppConfiguration, PingConfig, HttpResponseConfig
Response / SSEStatusCode, IKoaSSE, IKoaSSEvent, SSEOptions
Functionssuccess, failed, result, response, error, initContext, middlewares.KoaSSEMiddleware

On @axiosleo/koapp 1.3.3 and earlier the context/router/config types above (everything except ContextFromSpec, RequiredContext, SocketContext, WebSocketContext and the *ApplicationConfig family) were not exported; recover the context type there with type KoaCtx = Router extends Router<infer C> ? C : never;.

Typing contexts: pick the right tool

ApproachData typingcontext.koaWhen
Default inference (new Router())loose (params?, body: any)fully typed (incl. sse)quick handlers, SSE, redirects
KoaContext<P, B, Q>typed but optional (params?.)fully typedHTTP handlers touching koa
KoaContext<P, B, Q> & { params: P; body: B; query: Q }strict, requiredfully typeduploads, sessions + typed data - preferred for HTTP
ContextFromSpec<{...}>strict, required, object-styleany (via index signature)transport-agnostic data handlers
RequiredContext<P, B, Q>strict, positionalanysame, positional style
SocketContext<P, B, Q> / WebSocketContext<P, B, Q>strict via genericsn/a (socket instead)TCP / WebSocket handlers

Define the required-props HTTP variant once and reuse it:

typescript
import { Router, KoaContext, success } from '@axiosleo/koapp';

type HttpContext<P = Record<string, string>, B = any, Q = any> =
  KoaContext<P, B, Q> & { params: P; body: B; query: Q };

type CreateUserContext = HttpContext<
  { id: string },
  { name: string; email: string; age?: number },
  { format?: 'json' | 'xml' }
>;

const router = new Router('/api');

router.post<CreateUserContext>('/users/{:id}', async (context) => {
  const id = context.params.id;        // string - required, no ?.
  const name = context.body.name;      // string
  const format = context.query.format; // 'json' | 'xml' | undefined
  context.koa.set('X-Handled-By', 'user-service'); // koa fully typed
  success({ id, name, format });
});

ContextFromSpec is the object-style alternative (order-free, declare only what you need) when the handler never touches context.koa:

typescript
import { ContextFromSpec } from '@axiosleo/koapp';

type SearchContext = ContextFromSpec<{ body: { q: string } }>;

Three levels of Router generics

typescript
// 1. Router-level: every handler on this router gets the type
const productRouter = new Router<ProductContext>('/products');

// 2. Per-route override: any route can use its own context type
router.get<UserContext>('/profile/{:id}', async (context) => { /* ... */ });

// 3. Sub-router with a different context via router.new<U>()
const admin = router.new<AdminContext>('/admin', {
  middlewares: [async (context) => { /* typed as AdminContext */ }],
});

Validators attach per-route as the third argument, same as JavaScript:

typescript
router.post<CreateUserContext>('/users/{:id}', handler, {
  params: { rules: { id: 'required|integer' } },
  body: { rules: { name: 'required|string', email: 'required|email' } },
});

Typed shared middlewares

ContextHandler<T> (default T = KoaContext) is the type of every middleware, handler, and after-handler:

typescript
import { Router, error } from '@axiosleo/koapp';
import type { ContextHandler } from '@axiosleo/koapp';

const requestLogger: ContextHandler = async (context) => {
  console.log(`[${context.method}] ${context.pathinfo}`);
};

const requireAuth: ContextHandler = async (context) => {
  if (!context.koa.session?.user) {
    error(401, 'Unauthorized');
  }
};

const secured = new Router('/secure', {
  middlewares: [requestLogger, requireAuth],
});

Extending KoaContext (module augmentation)

KoaContext is an exported interface, so middlewares can attach their own typed properties to it - the monorepo scaffold's auth middleware uses exactly this pattern:

typescript
import { error } from '@axiosleo/koapp';
import type { ContextHandler } from '@axiosleo/koapp';

export interface AuthInfo {
  userId: string;
  isAdmin?: boolean;
}

declare module '@axiosleo/koapp' {
  interface KoaContext {
    auth?: AuthInfo;
  }
}

export const authMiddleware: ContextHandler = async (context) => {
  const header = context.headers?.authorization;
  if (!header) {
    error(401, 'Unauthorized');
  }
  context.auth = { userId: 'u_1' }; // typed as AuthInfo | undefined
};

Every handler in the project now sees context.auth with full typing.

Show full SKILL.md (254 more words)Show less

Typed file uploads

Uploaded files live on context.koa.request.files, not on context.body - the TBody generic never covers them. Use the HttpContext helper so both the data and koa are typed:

typescript
import multer from '@koa/multer';
import { Router, KoaContext, success, failed } from '@axiosleo/koapp';

type HttpContext<P = Record<string, string>, B = any, Q = any> =
  KoaContext<P, B, Q> & { params: P; body: B; query: Q };

type UploadContext = HttpContext<{ dir: string }>;

router.post<UploadContext>('/upload/{:dir}', async (context) => {
  const upload = multer({ storage: multer.memoryStorage() });
  await upload.any()(context.koa, async () => {});

  // files: { [field: string]: File[] } | File[] | undefined - narrow it
  const files = context.koa.request.files;
  const first = Array.isArray(files) ? files[0] : undefined;
  if (!first) {
    failed({}, '400;Bad Data', 400);
  }
  success({ dir: context.params.dir, name: first.originalname });
});

With upload.single('avatar') the file is at context.koa.request.file (type multer.File). See examples.md for the full recipes.

Response helpers: generics and never

All helpers are generic and return never - TypeScript knows execution stops there, so calls double as type guards:

typescript
const user = await findUser(id); // User | null
if (!user) {
  failed({ id }, '404;Not Found', 404);
}
user.name; // user narrowed to User - no ! needed
success<User>(user);

The StatusCode type accepts any "<number>;<text>" string; presets like '200;Success', '404;Not Found', '409;Data Already Exists' are listed in koapp-response.

Typed application configs

typescript
import {
  KoaApplication, Router,
  type KoaApplicationConfig, type TypedKoaApplicationConfig,
} from '@axiosleo/koapp';

const config: KoaApplicationConfig = {
  listen_host: '0.0.0.0',
  port: 8080,
  routers: [router], // mixed Router<...> types allowed
};
new KoaApplication(config).start();

// Strict variant: all routers must match the given type
type UserRouter = Router<CreateUserContext>;
const strict: TypedKoaApplicationConfig<UserRouter[]> = {
  listen_host: 'localhost',
  port: 8081,
  routers: [userRouter1, userRouter2],
};

SocketAppConfiguration adds port + ping; WebSocketAppConfiguration additionally accepts every ws ServerOptions field (maxPayload, clientTracking, ...).

Common pitfalls

  • Retype data via the generic form: KoaContext<P, B, Q> & { params: P; ... } works, but intersecting the default-parameterized alias (KoaCtx & { body: B }) collapses to any because the default body is already any.
  • Do not Omit<KoaContext, 'body'> - the base context carries a [key: string]: any index signature that makes Omit drop every named property.
  • That same index signature means typos like context.bodyy compile silently as any. Prefer strictly typed contexts so real fields are checked.
  • Uploaded files are never in TBody; type them through context.koa (see above).
  • Two copies of @types/koa in the dependency tree make context.koa.request.files "not exist" - install @types/koa directly so everything resolves to one copy.
  • initContext (custom transports) is exported and generic; it is an advanced escape hatch and rarely needed - see index.d.ts if you build your own transport.

See also

  • Copy-paste TypeScript recipes: examples.md
  • Route/validator basics (JavaScript): koapp-router
  • Building and configuring servers: koapp-apps
  • Response helpers and status codes: koapp-response

© AxiosLeo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in assets/skills/koapp-typescript of AxiosLeo/node-koapp.

  • SKILL.md
  • examples.md

Open the folder on GitHubat commit 102955d

Compare with similar skills

Koapp Typescript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Koapp Typescript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Koapp Typescript this skillAxiosLeo/node-koapp145—~2.6kAutomated safety check: PassMIT
Convexopenclaw/clawhub9.5k—~2.4kAutomated safety check: PassMIT
near-kit for NEAR Protocolinternet-court/internet-court-skill6.4k1 repos~2kAutomated safety check: PassCustom licence
Convex Designopenclaw/clawhub9.5k1 repos~967Automated safety check: NotesMIT
Supabase SDK Patternsjeremylongshore/tons-of-skills-marketplace2.8k—~1.6kAutomated safety check: PassMIT
GraphQL Operations with CodegenChrisWiles/claude-code-showcase6.1k3 repos~1.5kAutomated safety check: PassNone

Similar skills

  • Convex

    openclaw/clawhub

    Convex is the backend agents get right on the first try: an all-TypeScript reactive platform where the database, server functions, scheduling, file storage, auth, and realtime sync are one type-safe…

    9.5k GitHub stars~2.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • near-kit for NEAR Protocol

    internet-court/internet-court-skill

    Covers the near-kit TypeScript library for NEAR: reading contracts, sending tokens, transaction building, typed contracts, wallets, React hooks and sandbox testing.

    6.4k GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed
  • Convex Design

    openclaw/clawhub

    Design and build reactive, type-safe, production-grade backends on Convex.

    9.5k GitHub starsUsed in 1 repo~967 tokens
    Backend & APIsAuto-check: notes
  • Supabase SDK Patterns

    jeremylongshore/tons-of-skills-marketplace

    A skill your agent uses when implementing Supabase queries, auth, realtime, storage, or RPC calls with @supabase/supabase-js or supabase-py and you need production-ready, type-safe patterns that…

    2.8k GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • GraphQL Operations with Codegen

    ChrisWiles/claude-code-showcase

    Sets the rules for writing GraphQL queries and mutations in .gql files, running codegen, and using generated Apollo hooks with proper error and loading handling.

    6.1k GitHub starsUsed in 3 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • Edgestore Setup

    edgestorejs/edgestore

    A skill your agent uses when adding, extending, or troubleshooting EdgeStore file uploads, upload UI, or bucket access policies in a TypeScript/React application.

    454 GitHub stars~1.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from AxiosLeo/node-koapp

All 8 skills in this repo
  • Koapp

    AxiosLeo/node-koapp

    Overview of the @axiosleo/koapp framework - a Koa-based web, TCP socket, and WebSocket framework for Node.js.

    145 GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed
  • Koapp Apps

    AxiosLeo/node-koapp

    Choose and configure the right @axiosleo/koapp Application class - KoaApplication for HTTP, SocketApplication for TCP sockets, WebSocketApplication for WebSocket.

    145 GitHub stars~1.2k tokensUpdated 22 days ago
    Auto-check passed
  • Koapp Controller

    AxiosLeo/node-koapp

    Organize route handlers into reusable classes by extending the @axiosleo/koapp Controller base class.

    145 GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed
  • Koapp Model

    AxiosLeo/node-koapp

    Validate and serialize structured data with the @axiosleo/koapp Model class powered by validatorjs.

    145 GitHub stars~1.6k tokensUpdated 22 days ago
    Auto-check passed
  • Koapp Response

    AxiosLeo/node-koapp

    Send structured responses from @axiosleo/koapp handlers using success/failed/result/response/error helpers and HttpError/HttpResponse classes.

    145 GitHub stars~1.5k tokensUpdated 22 days ago
    Auto-check passed
  • Koapp Router

    AxiosLeo/node-koapp

    Define routes, path parameters, validators, and nested routers with the @axiosleo/koapp Router class.

    145 GitHub stars~1.6k tokensUpdated 22 days ago
    Auto-check passed

Works with

Questions about Koapp Typescript

What does Koapp Typescript do?

Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares…. Koapp Typescript is an agent skill from AxiosLeo/node-koapp. Write type-safe @axiosleo/koapp code in TypeScript - typed contexts (KoaContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext), Router generics, ContextHandler middlewares, module augmentation, typed file uploads with @koa/multer, response helper generics, and typed application configs.

When should I use Koapp Typescript?

Koapp Typescript fits situations like: A koapp project uses TypeScript; typing context.params/body/query; annotating route handlers; typing uploaded files.

How do I install Koapp Typescript in Claude Code?

Run `npx skills add AxiosLeo/node-koapp --skill koapp-typescript -a claude-code`. Or copy the skill folder (assets/skills/koapp-typescript in AxiosLeo/node-koapp) into .claude/skills/koapp-typescript in your project. Claude Code loads it when a task matches its description.

How do I install Koapp Typescript in Codex?

Run `npx skills add AxiosLeo/node-koapp --skill koapp-typescript -a codex`. Or copy the skill folder (assets/skills/koapp-typescript in AxiosLeo/node-koapp) into .agents/skills/koapp-typescript in your project. Codex loads it when a task matches its description.

Can I use Koapp Typescript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AxiosLeo/node-koapp --skill koapp-typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/koapp-typescript, .gemini/skills/koapp-typescript, .github/skills/koapp-typescript and .opencode/skills/koapp-typescript in your project.

What does Koapp Typescript need to run?

Going by SKILL.md and its folder, Koapp Typescript needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Koapp Typescript access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Koapp Typescript safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Koapp Typescript use?

Koapp Typescript is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Koapp Typescript use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Koapp Typescript?

Skills that share tags, products or a category with Koapp Typescript: Convex (openclaw/clawhub, 9.5k stars), near-kit for NEAR Protocol (internet-court/internet-court-skill, 6.4k stars), Convex Design (openclaw/clawhub, 9.5k stars) and Supabase SDK Patterns (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Koapp Typescript?

AxiosLeo (a GitHub user) maintains it in AxiosLeo/node-koapp, which has 145 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 16, 2026.

Source: AxiosLeo/node-koapp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.