Data Provider logo

Data Provider

Organization
PatternsDev
data-provider

Teaches the data provider pattern using renderless components and scoped slots. Use when you need to abstract data fetching or state management logic and expose it to child components via slots.

Overview

PublisherPatternsDev
Repositoryskills
Skill namedata-provider
Stars
250
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by PatternsDev on GitHub. Read the source before you install it.

Installation

Install the Data Provider AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/vue/data-provider .claude/skills/data-provider
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Data Provider in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Data Provider on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Data Provider is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Data Provider Pattern

Table of Contents

In a previous article, we've come to learn how renderless components help separate the logic of a component from its presentation. This becomes useful when we need to create reusable logic that can be applied to different UI implementations.

Renderless components also allow us to leverage another helpful pattern known as the data provider pattern.

When to Use

  • Use this when multiple components need to consume the same data but display it differently
  • This is helpful for centralizing data-fetching logic without coupling it to specific UI components

When NOT to Use

  • When composables can handle the data logic without the extra component layer (Vue 3+)
  • When only one component consumes the data — a composable or inline fetch is simpler
  • When the data-provider nesting adds indirection that makes the template harder to follow

Instructions

  • Create a data provider component whose template is a single <slot> with scoped slot props
  • Pass data, loading state, and action methods as scoped slot props to child components
  • Use v-slot destructuring in the parent to access provided data
  • Keep child components focused purely on presentation; the data provider handles all data logic

Details

Data Provider Pattern

The data provider pattern is a design pattern that complements the renderless component pattern in Vue by focusing on providing data and state management capabilities to components without being concerned about how the data is rendered or displayed.

In the data provider pattern, a data provider component encapsulates the logic for fetching, managing, and exposing data to its child components. The child components can then consume this data and use it in their own rendering or behavior.

This pattern promotes separation of concerns, as the data provider component takes care of data-related tasks, while the child components can focus on presentation and interaction.

Let's illustrate the data provider pattern with an example. Consider a simple application that displays the setup of a funny joke followed by its punchline. To keep the example self-contained, we'll use a local in-memory data source instead of depending on an external API.

js
const jokes = [
  { id: 1, setup: "Why did the dev go broke?", punchline: "Because they used up all their cache." },
  { id: 2, setup: "Why do functions love TypeScript?", punchline: "Because it keeps their arguments in order." },
];

We'll first create a data provider component called DataProvider that will hold the responsibility of loading a joke. In the <script> section of the component, we'll import the ref() and reactive() functions from Vue, define a local data source, and set up data and loading reactive properties to capture the selected joke and loading state.

html
<script setup>
  import { ref, reactive } from "vue";

  const jokes = [
    { id: 1, setup: "Why did the dev go broke?", punchline: "Because they used up all their cache." },
    { id: 2, setup: "Why do functions love TypeScript?", punchline: "Because it keeps their arguments in order." },
  ];

  const data = reactive({
    setup: null,
    punchline: null,
  });

  const loading = ref(false);
</script>

We can then create a fetchJoke() function in our DataProvider component to simulate loading data asynchronously.

js
const fetchJoke = async () => {
  loading.value = true;
  try {
    await new Promise((resolve) => setTimeout(resolve, 300));
    const jokeData = jokes[Math.floor(Math.random() * jokes.length)];
    data.setup = jokeData.setup;
    data.punchline = jokeData.punchline;
  } catch (error) {
    console.error("Error loading joke:", error);
  } finally {
    loading.value = false;
  }
};

With the fetch function ready, we can call it when the component mounts using the onMounted() lifecycle hook.

js
import { ref, reactive, onMounted } from "vue";

// ...

onMounted(() => {
  fetchJoke();
});

The key element in a data provider component is that its template consists purely of a single <slot> element. This slot will provide the fetched data and the relevant method to its child components using scoped slots.

html
<template>
  <slot :data="data" :loading="loading" :fetchJoke="fetchJoke"></slot>
</template>

The DataProvider component passes data, loading, and fetchJoke as scoped slot props. This means any child component placed inside the DataProvider can access these properties.

Now, let's create a JokeCard component that will present the joke data.

html
<template>
  <div class="joke-card">
    <p v-if="loading">Loading...</p>
    <div v-else>
      <p class="setup">{{ data.setup }}</p>
      <p class="punchline">{{ data.punchline }}</p>
    </div>
    <button @click="fetchJoke">Get Another Joke</button>
  </div>
</template>

<script setup>
  defineProps(["data", "loading", "fetchJoke"]);
</script>

The JokeCard component is a simple presentational component. It expects data, loading, and fetchJoke as props, and renders the joke data along with a button to fetch a new joke.

Now, to bring it all together, we use the DataProvider component in our App component. We wrap the JokeCard component inside the DataProvider and pass the scoped slot props to it:

html
<template>
  <DataProvider v-slot="{ data, loading, fetchJoke }">
    <JokeCard :data="data" :loading="loading" :fetchJoke="fetchJoke" />
  </DataProvider>
</template>

<script setup>
  import DataProvider from "./components/DataProvider.vue";
  import JokeCard from "./components/JokeCard.vue";
</script>

With this setup, the DataProvider handles all data fetching and management, while the JokeCard focuses solely on displaying the data. This clean separation makes it easy to swap out the presentational component for a different one without touching the data-fetching logic.

The data provider pattern is especially useful when:

  • Multiple components need to consume the same data but display it differently.
  • You want to centralize data fetching logic without tightly coupling it to specific UI components.
  • You want to keep your components focused on a single responsibility.

Source

References

Frequently asked questions

What does the Data Provider AI skill do?

Teaches the data provider pattern using renderless components and scoped slots. Use when you need to abstract data fetching or state management logic and expose it to child components via slots.

Why use Data Provider on TypingMind?

Because you install it once and use it with any model. Data Provider is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Data Provider in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/PatternsDev/skills/tree/main/vue/data-provider. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Data Provider?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Data Provider?

As many as you like. As long as a model supports skills, you can use Data Provider with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Data Provider AI skill free?

Yes. It is published on GitHub by PatternsDev under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇