koapp-typescript

TypeScript guidance for writing typed code with the @axiosleo/koapp framework. It covers typed request contexts, routers, handlers, applications, responses, errors, and file uploads.

In plain words
What is it for?
Use it when defining typed Koa, socket, or WebSocket applications; writing typed routes and middleware; extending request context data; or handling uploaded files.
Why use it?
It helps TypeScript code use koapp's type system correctly, including dependencies and cases where the standard generic types need extra setup.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/axiosleo/node-koapp/koapp-typescript
Any agent
npx skills add AxiosLeo/node-koapp --skill koapp-typescript
Clone the repo
git clone --depth 1 https://github.com/AxiosLeo/node-koapp

Made for: Claude Code, Codex.

Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00110 $0.02706
Opus 5 $0.00055 $0.01353
Sonnet 5 $0.00022 $0.00541
Haiku 4.5 $0.00011 $0.00271

Measured 2d ago against content hash 5cfb0d62b632, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

koapp-typescript scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

assets/skills/koapp-typescript/SKILL.md · 276 lines

How it starts

The opening of the file, as written. The whole thing — 276 lines — stays where its author put it; the contents beside it link to each section on GitHub.

@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

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':

Category Symbols
Classes KoaApplication, SocketApplication, WebSocketApplication, Application, Router, Controller, Model, HttpResponse, HttpError, SocketClient
Context types KoaContext, AppContext, ContextFromSpec, RequiredContext, SocketContext, WebSocketContext, ContextDataSpec, ContextHandler
Router types RouterOptions, RouterInfo, RouterValidator, ValidatorConfig, HttpMethod
Config types AppConfiguration, TypedAppConfiguration, KoaApplicationConfig, TypedKoaApplicationConfig, SocketAppConfiguration, TypedSocketAppConfiguration, WebSocketAppConfiguration, TypedWebSocketAppConfiguration, PingConfig, HttpResponseConfig
Response / SSE StatusCode, IKoaSSE, IKoaSSEvent, SSEOptions
Functions success, failed, result, response, error, initContext, middlewares.KoaSSEMiddleware

On @axiosleo/koapp 1.3.2 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;.

Read the full file on GitHub · 276 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 276 lines · 110 tokens per session scan A 5cfb0d62b632

Subscribe to this mod's changes

koapp-typescript is a skill published in the GitHub repository AxiosLeo/node-koapp (145 stars, last pushed 19d ago), licensed MIT. It adds 110 tokens to every session and 2,706 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.