Next.js Discord

Discord Forum

Best way to integrate a SKILL into a chatbot with AI SDK

Unanswered
Common paper wasp posted this in #help-forum
Open in Discord
Common paper waspOP
Hey guys,

I am building a lovely NextJS App around a SKILL that I made myself. In a nutshell the skill makes the AI to an expert in a small niche.

If I run the skill inside Codex (Read the XYZ SKILL, please help me with the following problem...) I get great results inside OpenAI CODEX App with GPT 5.4 and Medium Thinking.

But I get way worse results when trying to utilize the SKILL inside a Chat I implemented with the AI SDK.

What is the best way to utilize a SKILL - that follows the skills.sh build up with AI SDK?

1 Reply

Rottweiler
Sounds like the issue is probably how the skill context is being passed to the AI SDK. In Codex, it likely gets the full skill prompt and memory upfront, but in your own chat implementation, if you’re just sending it as a single message or not including all the instructions, the model won’t have the same context.

The best approach with the AI SDK is to inject the skill fully into the system message at the start of the conversation or use a structured “skill” object if the SDK supports it, so every turn of the chat has the skill’s instructions and constraints. Also make sure to include any relevant examples or step-by-step guidance from your skill to match the Codex results.