Back to list
aniftyco

kubit-designing-api

by aniftyco

[IDEA] TypeScript-first MVC full-stack framework for the modern web

32🍴 2📅 Jan 8, 2026

SKILL.md


name: kubit-designing-api description: Use when adding new API surface, modifying existing APIs, or defining TypeScript types for framework features. Use when discussing method signatures, return types, decorator APIs, or module exports.

Designing Kubit APIs

Overview

Design APIs by starting with ideal usage in skeleton/, then codifying as types in packages/core/, then documenting in SPEC.md.

When to Use

  • Adding new method, decorator, or export to framework
  • Modifying existing API signatures
  • Defining types in packages/core/*.d.ts
  • User asks "how should this API look?"

API Design Flow

digraph api_flow {
  "Write usage in skeleton/" -> "Add types to packages/core/" -> "Document in SPEC.md" -> "Verify tsc passes";
}
  1. Usage First: Write the ideal developer experience in skeleton/
  2. Types Second: Add ambient types to make it compile
  3. Spec Third: Document with TypeScript signatures
  4. Verify: Run tsc --noEmit in skeleton/

Design Principles

PrincipleApplication
DX FirstHow does this feel to use? Start from skeleton.
Type SafetyCan TypeScript catch mistakes at compile time?
ConventionsFollow Laravel/Rails patterns where sensible
Minimal APISmallest surface that solves the problem
ExtensibilityCan users extend without modifying core?

Patterns in Use

Decorators: @column(), @before(), @property(), @use() - metadata on classes/properties

Method Chaining: router.get('/').name('home') - fluent API for configuration

Controller Tuples: [Controller, 'method'] - type-safe handler references

Lazy Relations: @hasMany(() => Post) - arrow function to avoid circular deps

Static Dispatch: Job.dispatch({}), Mailable.send({}) - class-level entry points

Type Definition Location

All public types go in packages/core/:

FileContents
kubit.d.tsdefineConfig, env, use
router.d.tsrouter object, handler types
orm.d.tsModel, column decorators, relations
queue.d.tsJob, @property
mail.d.tsMailable
db.d.tsMigration, schema
inertia.d.tsview()
http.d.tsHttpContext
hash.d.tshash()

Checklist Before Adding API

  • Usage example exists in skeleton/
  • Types added to packages/core/
  • tsc --noEmit passes in skeleton/
  • SPEC.md updated with TypeScript signature
  • Follows existing patterns (decorators, chaining, etc.)

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon