kui-framework

kui-framework is a skill for Claude Code, Codex from abersheeran/kui. It costs 44 tokens per session (4,235 once invoked), scanned A, original, Apache-2.0.

A guide to Kui, a Python web framework for building web applications. It covers both ASGI for asynchronous applications and WSGI for synchronous applications, along with routes, request parameters, middleware, and API documentation.

In plain words
What is it for?
Use it when creating Kui routes and handlers, binding typed parameters, adding dependency injection or middleware, configuring OpenAPI documentation, and choosing ASGI or WSGI imports.
Why use it?
It provides framework-specific direction when general Python web advice is not enough. It helps keep handlers, configuration, and generated API documentation consistent with Kui.

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/abersheeran/kui/kui-framework
Any agent
npx skills add abersheeran/kui --skill kui-framework
Clone the repo
git clone --depth 1 https://github.com/abersheeran/kui

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kui-framework

README.md
[![agentmods](https://agentmods.dev/badge/skills/abersheeran/kui/kui-framework.svg)](https://agentmods.dev/skills/abersheeran/kui/kui-framework)
Your own site
<a href="https://agentmods.dev/skills/abersheeran/kui/kui-framework"><img src="https://agentmods.dev/badge/skills/abersheeran/kui/kui-framework.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,235 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.00044 $0.04235
Opus 5 $0.00022 $0.02117
Sonnet 5 $0.00009 $0.00847
Haiku 4.5 $0.00004 $0.00424

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

Security

Grade A, and why

kui-framework 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 5d 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.

skills/kui-framework/SKILL.md · 659 lines

How it starts

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

Kui Web Framework Guide

Kui is a Python web framework supporting both ASGI (async) and WSGI (sync). It provides type-safe parameter binding via Annotated, dependency injection, OpenAPI documentation generation, class-based views, and middleware composition.

ASGI imports: from kui.asgi import ... WSGI imports: from kui.wsgi import ...

The two modules expose nearly identical APIs; ASGI handlers are async def, WSGI handlers are plain def. All examples below use ASGI unless noted.

1. Application

from kui.asgi import Kui, OpenAPI

app = Kui(
    routes=[],                  # Initial routes
    http_middlewares=[],         # App-level HTTP middleware
    socket_middlewares=[],       # App-level WebSocket middleware (ASGI only)
    cors_config=None,           # Optional CORSConfig dict
    exception_handlers={},      # {status_or_exc_type: handler}
    on_startup=[], on_shutdown=[],  # Lifespan callbacks (ASGI only)
    templates=None,             # Optional Jinja2Templates instance
    response_converters={},     # {type: converter_func}
    json_encoder={},            # {type: serializer_func}
)

app is a standard ASGI callable (async def __call__(scope, receive, send)). For WSGI it is a standard def __call__(environ, start_response).

Shared state

app.state.db = create_pool()   # Set once; ImmutableAttribute prevents reassignment

2. Routing

2.1 Decorator style (most common)

@app.router.http.get("/users/{user_id:int}")
async def get_user(user_id: Annotated[int, Path()]):
    return {"id": user_id}

@app.router.http.post("/users")
async def create_user(body: Annotated[UserCreate, Body()]):
    return body, 201

# Any HTTP method
@app.router.http("/health")
async def health():
    return "ok"

Available method shortcuts: .get(), .post(), .put(), .patch(), .delete().

Decorator parameters: path, name=, middlewares=[], summary=, description=, tags=.

2.2 Route objects with << operator

Read the full file on GitHub · 659 lines

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. 5d ago First seen · 659 lines · 44 tokens per session scan A e693ee289f22

Subscribe to this mod's changes

kui-framework is a skill published in the GitHub repository abersheeran/kui (297 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 4,235 once invoked, about $0.0002 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.