forinda/kickjs-examples-archive/add-adapter
Claude Code and agent skill by forinda/kickjs-examples-archive
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
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-examples-archive/add-adapterSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as forinda/kickjs-examples-archive/add-adapter.
Steps:
kick g adapter <name>to scaffold the boilerplate, OR install viakick add <package>for first-party adapters.- The generated file uses
defineAdapter()— neverclass implements AppAdapter. - Add the adapter instance (note the parens) to
src/adapters/index.ts— don't inline insrc/index.ts. - Pick the right hook and middleware phase deliberately.
- Verify with
kick devthat the adapter's lifecycle logs fire.
Canonical shape — factory closure owns instance state:
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 undercreateTestApptoo.afterStart— server hasctx.serveravailable. Only use for things that need a listening server (Socket.IO upgrades, port logging). Doesn't fire under `createTestApp`.shutdown— runs concurrently viaPromise.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 forconfigwill be wrong. - Using
.async()for an adapter that returnsmiddleware()/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 throwMountCycleErrorat boot. - Using an adapter when the integration ships modules + DI bindings + middleware together → that's a plugin. Promote to
definePlugin()(seeadd-pluginskill).
Nuances:
AdapterContext.serverisundefinedoutsideafterStart.shutdownerrors are swallowed byPromise.allSettled— wrap in try/catch and log if you care.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfullstack-app/server/.agents/skills/add-adapter/SKILL.md
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
[](https://verified-skill.com/skills/forinda/kickjs-examples-archive/add-adapter)