Skip to main content

kickjs-thin-entry-file

Use when src/index.ts is accumulating module/middleware/plugin/adapter literals.

Source facts

Repository
forinda/tasky
Last source activity
August 6, 2026 at 16:02
Detected SKILL.md language
English
Stars
0
Forks
1

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
kickjs-thin-entry-file
description
Use when src/index.ts is accumulating module/middleware/plugin/adapter literals.
<!-- Generated by `kick g agents` for adero-api. Edits are overwritten on the next refresh; keep customisation in a SKILL.local.md alongside. --> **Refactor target**: ```ts // src/modules/index.ts — fluent chain (default for `modules.style: 'define'`) export const modules = defineModules().mount(HelloModule()).mount(UsersModule()) // OR for class-form projects (`modules.style: 'class'`): // export const modules: AppModuleEntry[] = [HelloModule, UsersModule] // src/middleware/index.ts — global middleware uses RAW EXPRESS signature // (req, res, next), NOT (ctx, next) export const middleware = [requestId(), express.json(), helmet(), cors(), traceContext()] // src/plugins/index.ts export const plugins = [MetricsPlugin(), AuthPlugin({ tokenTtl: env.TOKEN_TTL })] // src/adapters/index.ts export const adapters = [SwaggerAdapter({ ... }), DevToolsAdapter()] // src/index.ts — stays small import 'reflect-metadata' import './config' // MUST be early — side-effect schema load import { bootstrap } from '@forinda/kickjs' import { modules } from './modules' import { middleware } from './middleware' import { plugins } from './plugins' import { adapters } from './adapters' export const app = await bootstrap({ modules, middleware, plugins, adapters }) ``` **One-off DI binding** — inline a literal plugin inside `plugins`, not a top-level option: ```ts plugins: [ ...plugins, { name: 'vector-store', register(c) { c.registerInstance(VECTOR_STORE, store) } }, ] ``` **Red flags**: - Any `new SomeAdapter()` / `SomePlugin()` literal inside `bootstrap({ ... })` instead of imported from a category folder. - Mixing middleware signatures: `bootstrap({ middleware })` is **raw Express** `(req, res, next)`; `@Middleware()` decorators are `(ctx, next)`; adapter middleware is raw Express again. Wrong shape in the wrong slot throws "Cannot read properties of undefined". - `bootstrap({ register: ... })` — that option doesn't exist. Use an inline plugin.
View on GitHub