AGENT SKILL

quick-api

Use when scaffolding a new API endpoint — types, test, handler, validation, route, docs

适用职业开发工程师
使用场景后端与接口
License 许可
Apache-2.0
最近更新
2026-10-11
Stars
★ 7
Forks
8

01 前言 Front Matter

name
quick-api
arguments
[ { "name": "endpoint", "required": true, "description": "Endpoint description, e.g. 'POST /api/users — create user'" } ]
description
Use when scaffolding a new API endpoint — types, test, handler, validation, route, docs
disable-model-invocation
true

03 SKILL.md 正文

Quick API Scaffold Workflow

Step 1: Detect Framework

  • Auto-detect from project:
    • Python: FastAPI (main.py, routers/), Flask, Django
    • JS/TS: Next.js (app/api/), Express, Hono
    • Go: net/http, gin, echo
  • Find existing endpoint examples to match patterns

Step 2: API Contract (Types First)

  • Define request/response types BEFORE implementation
  • Place types where project keeps them (types/, schemas/, models/)
  • Include validation rules in type definitions
  • Document in OpenAPI format if project uses it

Step 3: Write Test First

  • Create test file matching project conventions
  • Test cases:
    • Happy path (valid request → expected response)
    • Validation error (invalid input → 400/422)
    • Auth error if endpoint requires auth (no token → 401)
    • Not found if applicable (→ 404)

Step 4: Checkpoint

  • checkpoint: before quick-api $endpoint

Step 5: Implement Handler

  • Follow existing handler patterns exactly
  • Input validation using project's validation approach
  • Error handling matching existing patterns
  • Keep handler thin — business logic in service layer if project uses one

Step 6: Register Route

  • Add route in the project's routing configuration
  • Match URL pattern, middleware, and auth guards from existing routes

Step 7: Verify

  • Run tests — all pass
  • Test manually with curl if appropriate
  • Check that OpenAPI/Swagger docs update if auto-generated

Step 8: Commit

  • feat: add $endpoint endpoint

04 同仓库更多 Skills

KeiSeiLab
KeiSeiLab/KeiSeiKit

wave-audit

3-wave parallel audit — Wave 1 discovery (4 agents), Wave 2 verification (4 agents), Wave 3 cross-optimization (1 synthesizer). Each wave runs agents in parallel. Combines security review, runtime analysis, quality check, and constructor pattern into one unified workflow with evidence grading and Go/No-Go verdict.

Skill与智能体开发
★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

vm-provision

End-to-end VPS provisioning — select provider → plan → provision → harden → verify (ssh-check + firewall-diff hard-gate) → handoff. 6 phases, ≥6 AskUserQuestion calls, defensive-only. Stops if either verification primitive fails.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

visual-explainer

Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.

数据分析师前端开发
★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

video-gen

Use when generating video from frame sequences — FFmpeg extraction, WebP/AVIF conversion, sprite sheets, scroll-synced playback, video encoding/transcoding. Covers the full pipeline from video source to web-ready frame sequence or optimized video.

图像与多媒体
★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

test-matrix

Use when a project needs testing BEYOND unit tests — fuzzing, property-based, load, E2E, or mutation. Five-phase hub-and-spoke pipeline composes the right mix per language × critical path × CI target, scaffolds configs + corpus + fixtures, wires CI jobs, and defines the crash/regression triage workflow. Pure-click: every decision except intake is an AskUserQuestion.

测试与质量
★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

test-gen

Use when generating tests for untested code — happy path, edge cases, error handling

测试与质量
★ 7