Agent skill

Koapp Response

by AxiosLeo in AxiosLeo/node-koapp

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

MITAuto-check passedBackend & APIs

Install Koapp Response

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

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

GitHub CLI
$ gh skill install AxiosLeo/node-koapp koapp-response --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-response .claude/skills/koapp-response && 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-response
GitHub stars
145
Token cost
~1.5k tokens
SKILL.md length
464 words
Files
2
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

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

  • Returning JSON envelopes
  • SKILL.md covers Import, Helper reference, JSON envelope and Raw pass-through with result(), plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Custom HTTP status codes

What it does

Koapp Response is an agent skill from AxiosLeo/node-koapp. Send structured responses from @axiosleo/koapp handlers using success/failed/result/response/error helpers and HttpError/HttpResponse classes. Use when returning JSON envelopes, custom HTTP status codes, raw HTML/text, error responses, or when setting response headers from a koapp route handler or controller method.

Its SKILL.md is about 1.5k 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. The repository describes itself as: About Design for quickly developing OpenAPI applications using Node.js. The licence is MIT.

When your agent uses it

  • Returning JSON envelopes
  • Custom HTTP status codes
  • Error responses
  • Setting response headers from a koapp route handler

Example prompts

  • “/koapp-response”

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript and json).

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

  • Network

    No URLs in SKILL.md.

    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 Response loads about 1.5k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 464 words of instructions outside code blocks.

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

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). 464 words, ~1,537 tokens.

Download SKILL.mdSave it as .claude/skills/koapp-response/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
koapp-response
description
Send structured responses from @axiosleo/koapp handlers using success/failed/result/response/error helpers and HttpError/HttpResponse classes. Use when returning JSON envelopes, custom HTTP status codes, raw HTML/text, error responses, or when setting response headers from a koapp route handler or controller method.

@axiosleo/koapp Response Helpers

Source: src/response.js.

@axiosleo/koapp uses throw-based response helpers: you call one of the helpers and it throws a typed object that the framework's workflow catches and writes to the wire. This keeps route handlers linear (no need to return) and lets middlewares/afters run consistently.

Import

javascript
const {
  success,
  failed,
  result,
  response,
  error,
  HttpError,
  HttpResponse
} = require('@axiosleo/koapp');

Helper reference

HelperSignaturePurpose
success(data?, headers?)(data: any, headers: Record<string,string>) => never200 OK, JSON envelope with code: '200;Success'
failed(data?, code?, status?, headers?)(data: any, code?: string, status?: number, headers?) => neverNon-2xx with JSON envelope; defaults code: '501;Internal Server Error', status: 501
response(data, code?, status?, headers?, format?)Full control JSON envelopeExplicit code, status, headers, format (`'json'
result(data, status?, headers?)Raw body pass-throughBypass the JSON envelope and write data as-is
error(status, msg, headers?)Error with empty payloadShortcut for response({}, '<status>;<msg>', status, headers)

All helpers never return - they throw.

JSON envelope

success, failed, response, and error produce the framework's standard envelope:

json
{
  "request_id": "uuid",
  "timestamp": 1714651200000,
  "code": "200;Success",
  "message": "Success",
  "data": { }
}

code follows the "<status>;<message>" convention:

  • "200;Success"
  • "400;Bad Request"
  • "404;Not Found"
  • "500;Internal Server Error"

Both parts are mirrored into data (so message is still readable when clients only unpack code). Custom codes are free-form strings.

Raw pass-through with result()

Use result() when you need to emit HTML, plain text, binary, or a pre-built JSON body without the envelope wrapping:

javascript
const { result } = require('@axiosleo/koapp');

router.get('/page', async () => {
  result('<h1>Hello</h1>', 200, { 'Content-Type': 'text/html' });
});

router.get('/raw-json', async () => {
  result(JSON.stringify({ hello: 'world' }), 200, {
    'Content-Type': 'application/json'
  });
});

result() sets notResolve: true internally so the envelope is skipped.

Error helpers

javascript
const { failed, error } = require('@axiosleo/koapp');

router.post('/login', async (context) => {
  const user = await findUser(context.body.email);
  if (!user) {
    error(404, 'User Not Found');
  }
  if (!verify(context.body.password, user.password)) {
    failed({ email: context.body.email }, '401;Unauthorized', 401);
  }
  // ... success response ...
});

HttpError for validation / system errors

HttpError is primarily used internally (e.g. by Model when validation fails), but handlers may throw it to short-circuit with a plain error body:

javascript
const { HttpError } = require('@axiosleo/koapp');

router.get('/guarded', async (context) => {
  if (!context.koa.session.user) {
    throw new HttpError(401, 'Please log in', { 'WWW-Authenticate': 'Bearer' });
  }
});

The framework catches it in the workflow and writes status=401, the message, and any headers.

HttpResponse class

HttpResponse is the class behind all helpers. You normally won't instantiate it directly, but it's useful to know its shape:

javascript
new HttpResponse({
  status: 200,
  data: { ... },
  code: '200;Success',
  headers: { 'X-Whatever': '1' },
  format: 'json',      // or 'text'
  notResolve: false    // if true, skip the envelope
});
Show full SKILL.md (179 more words)Show less

Status code presets (TypeScript)

The type definitions in index.d.ts list convenient string literals:

'200;Success'
'400;Bad Data'
'400;Invalid Signature'
'401;Unauthorized'
'403;Not Authorized'
'404;Not Found'
'409;Data Already Exists'
'500;Internal Server Error'
'501;Failed'
'000;Unknown Error'

Any "<number>;<text>" string is valid - the presets are just common ones.

Setting headers per response

Every helper accepts a headers argument:

javascript
success({ ok: true }, {
  'X-Request-Source': 'public-api',
  'Cache-Control': 'no-store'
});

result(buffer, 200, {
  'Content-Type': 'application/pdf',
  'Content-Disposition': 'attachment; filename="report.pdf"'
});

Direct Koa response

Inside an HTTP handler you can still write to context.koa directly when you need streaming, redirects, or pipelining:

javascript
router.get('/redirect', async (context) => {
  context.koa.redirect('/elsewhere');
});

router.get('/stream', async (context) => {
  context.koa.type = 'application/octet-stream';
  context.koa.body = fs.createReadStream(file);
});

Mixing raw Koa output with the throw helpers: the last to write wins. If you need raw streaming, skip the helpers entirely.

Common pitfalls

  • Forgetting success/failed/result/... throws, leading to code that runs after the "response" line. Treat them as terminal.
  • Calling success in a middleware (not a handler) stops execution just like in a handler - the workflow still catches and emits the response.
  • failed(data, status) does not work - the second arg is code, not status. Use failed(data, '400;Bad Data', 400) or switch to response(data, '400;Bad Data', 400).
  • Returning success(...) from a handler is redundant (it throws) and confusing to readers - do not return helper calls.

See also

  • Organize handlers into classes with wrapped helpers: koapp-controller
  • Validate body/params before responding: koapp-router
  • Concrete response recipes: examples.md

© 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-response of AxiosLeo/node-koapp.

  • SKILL.md
  • examples.md

Open the folder on GitHubat commit 102955d

Compare with similar skills

Koapp Response 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 Response compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Koapp Response this skillAxiosLeo/node-koapp145—~1.5kAutomated safety check: PassMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Nestjs Best Practicesrolling-scopes/rsschool-app10k6 repos~1.2kAutomated safety check: PassMIT
Sub2API AdminWei-Shaw/sub2api44k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC
Obsidian BasesAtmosphere/atmosphere3.8k22 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Nestjs Best Practices

    rolling-scopes/rsschool-app

    NestJS best practices and architecture patterns for building production-ready applications.

    10k GitHub starsUsed in 6 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    44k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Obsidian Bases

    Atmosphere/atmosphere

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries.

    3.8k GitHub starsUsed in 22 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    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 23 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 23 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 23 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 23 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 23 days ago
    Auto-check passed
  • Koapp Sse

    AxiosLeo/node-koapp

    Stream Server-Sent Events (SSE) from a @axiosleo/koapp Koa route using the KoaSSEMiddleware.

    145 GitHub stars~1.5k tokensUpdated 23 days ago
    Auto-check passed

Categories

Questions about Koapp Response

What does Koapp Response do?

Send structured responses from @axiosleo/koapp handlers using success/failed/result/response/error helpers and HttpError/HttpResponse classes. Koapp Response is an agent skill from AxiosLeo/node-koapp. Send structured responses from @axiosleo/koapp handlers using success/failed/result/response/error helpers and HttpError/HttpResponse classes.

When should I use Koapp Response?

Koapp Response fits situations like: returning JSON envelopes; custom HTTP status codes; error responses; setting response headers from a koapp route handler.

How do I install Koapp Response in Claude Code?

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

How do I install Koapp Response in Codex?

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

Can I use Koapp Response 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-response -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-response, .gemini/skills/koapp-response, .github/skills/koapp-response and .opencode/skills/koapp-response in your project.

What does Koapp Response need to run?

SKILL.md names no scripts, command-line tools or credentials: Koapp Response is instructions for the agent only.

Does Koapp Response access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Koapp Response 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 Response use?

Koapp Response 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 Response use?

About 1.5k tokens (SKILL.md is roughly 6.1k 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 Response?

Skills that share tags, products or a category with Koapp Response: Configuring Horizon (coollabsio/coolify, 63k stars), Nestjs Best Practices (rolling-scopes/rsschool-app, 10k stars), Sub2API Admin (Wei-Shaw/sub2api, 44k stars) and Firecrawl Build Onboarding (firecrawl/firecrawl, 190k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Koapp Response?

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.