forinda/kickjs-series-yt/add-adapter

Claude Code and agent skill by forinda/kickjs-series-yt

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when wiring a single-concern lifecycle integration (Swagger, DevTools, Sentry, Redis client).

Install

npx vskill@latest install forinda/kickjs-series-yt/add-adapter

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as forinda/kickjs-series-yt/add-adapter.

Steps:

  1. kick g adapter <name> to scaffold the boilerplate, OR install via kick add <package> for first-party adapters.
  2. The generated file uses defineAdapter() — never class implements AppAdapter.
  3. Add the adapter instance (note the parens) to src/adapters/index.ts — don't inline in src/index.ts.
  4. Pick the right hook and middleware phase deliberately.
  5. Verify with kick dev that the adapter's lifecycle logs fire.

Canonical shape — factory closure owns instance state:

ts
export const RedisAdapter = defineAdapter<RedisConfig>({
name: 'RedisAdapter',
defaults: { url: 'redis://localhost' },
build: (config) => {
const client = createClient(config.url)
return {
beforeStart: ({ container }) => {
container.registerInstance(REDIS_CLIENT, client)
},
afterStart: () => client.connect(),
shutdown: () => client.quit(),
}
},
})
// In src/adapters/index.ts:
export const adapters = [RedisAdapter({ url: env.REDIS_URL })] // <-- note parens

Lifecycle hook decision tree:

  • beforeMount — register early routes that should bypass middleware (health, docs UI).
  • beforeStart — DI ready, server not listening yet. Use this for `container.registerInstance(...)` calls so they work under createTestApp too.
  • afterStart — server has ctx.server available. Only use for things that need a listening server (Socket.IO upgrades, port logging). Doesn't fire under `createTestApp`.
  • shutdown — runs concurrently via Promise.allSettled, so one failure doesn't block siblings (but errors are swallowed — log inside).

Middleware phases (see MiddlewarePhase JSDoc): beforeGlobal | afterGlobal (default) | beforeRoutes | afterRoutes (fires only on fall-through — matched routes that respond skip it).

Multi-instance — .scoped('cache', { url: ... }) makes name become RedisAdapter:cache. Deferred config — .async({ inject, useFactory }) for config that depends on DI-resolved services.

Red flags:

  • bootstrap({ adapters: [MyAdapter] }) — passed the factory, not the instance. Call it: MyAdapter().
  • Inlining the adapter list directly in src/index.ts — entry file should stay thin.
  • Returning a plain object instead of going through defineAdapter() — type inference for config will be wrong.
  • Using .async() for an adapter that returns middleware() / contributors() / beforeMount() / onRouteMount() — those hooks have already run by the time .async() resolves and are silently skipped.
  • Cross-adapter ordering via array position when it's load-bearing — use dependsOn: ['OtelAdapter']; cycles throw MountCycleError at boot.
  • Using an adapter when the integration ships modules + DI bindings + middleware together → that's a plugin. Promote to definePlugin() (see add-plugin skill).

Nuances:

  • AdapterContext.server is undefined outside afterStart.
  • shutdown errors are swallowed by Promise.allSettled — wrap in try/catch and log if you care.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/forinda/kickjs-series-yt/add-adapter/badge)](https://verified-skill.com/skills/forinda/kickjs-series-yt/add-adapter)

Something wrong with this skill or its page? Tell us.