Services Layer logo

Services Layer

OrganizationPopular
EpicenterHQ
services-layer

Apply Whispering service-boundary patterns for UI-free capabilities, explicit inputs, Result fallibility, Live objects, lifecycle factories, and platform variants. Use when creating or refactoring services, contracts, provider dispatch, or the `$lib/services` barrel.

Overview

PublisherEpicenterHQ
Repositoryepicenter
Skill nameservices-layer
Stars
4.8K
Forks
386
Bundled files
2
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.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Services Layer 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.
    https://github.com/EpicenterHQ/epicenter/tree/main/.agents/skills/services-layer
  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/EpicenterHQ/epicenter.git /tmp/epicenter
mkdir -p .claude/skills
cp -r /tmp/epicenter/.agents/skills/services-layer .claude/skills/services-layer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Services Layer 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 Services Layer 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 Services Layer 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.

Services Layer

This skill was grounded in Whispering's src/lib/services and its #platform/* mappings. Both were removed when Whispering became a standalone file-folder app, so every apps/whispering/... path below is historical. The patterns still apply; ground new work in the app you are editing and its own package.json. Neighboring skills are leads, not current architecture.

Product Sentence

The service layer owns UI-free capabilities; callers inject app policy through explicit inputs, fallible operations return Results, and platform selection has one build-time owner.

Boundary

Services may perform IO and may own service-local runtime state. They are not required to be pure functions. They must remain free of UI and app-owned policy:

  • no runtime reads of Svelte stores, settings, deviceConfig, toasts, or report;
  • accept credentials, model names, endpoints, paths, and user choices as inputs;
  • return domain data and errors, not presentation copy or UI state;
  • expose the same contract from both sides of a #platform/* seam.

$lib/operations usually reads app settings, chooses providers, and composes services. $lib/queries adds shared query identity and observable lifecycle only when the UI needs it.

The transcription directory also holds provider registry data and the UI-facing provider-ui.ts join. Those colocated metadata modules are not service implementations; do not use them to weaken the service boundary.

Model Fallibility Honestly

Use Result<T, E> for a public operation that can fail in ordinary runtime use. Adapt throwing platform or library calls with the error-handling skill.

Do not fake a Result for an infallible in-memory action or cleanup. Current examples include local shortcut register / unregister returning void and listener setup returning a cleanup function.

typescript
export type DownloadService = {
	downloadBlob(args: {
		name: string;
		blob: Blob;
	}): Promise<Result<void, DownloadError>>;
};

Errors belong to the layer that understands the failure. Preserve lower-layer tagged errors when composing services. Define a service-local variant only for a failure the service itself owns. Use error-handling for variant shape, message rules, adaptation, and propagation.

Direct Object Or Factory

Default to a direct *ServiceLive object when construction has no input or lifecycle. Current download, analytics, text, and transcription provider implementations use this shape. Download, analytics, and text check their shared platform contracts with satisfies <Service>.

Use a factory when it owns real construction inputs, replaceable dependencies, or stateful lifecycle. The browser and CPAL recorder factories earn their boundary because each creates recording sessions with stop, cancel, subscribe, and teardown behavior.

Do not add create* plus *Live mechanically for a stateless object.

Read service implementation patterns for the current direct-object example and the factory decision.

Platform And Runtime Selection

Use #platform/* imports for a capability with browser and Tauri implementations. package.json#imports chooses the implementation at build time; shared callers import one stable name and do not inspect window.__TAURI_INTERNALS__.

Use the nullable #platform/tauri namespace for Tauri-only capabilities.

User-selected providers are runtime policy, not a platform seam. Keep the dispatch in the consuming operation. Whispering transcription reads the selected provider in $lib/operations/transcribe.ts; the query layer only observes that operation.

Read service organization and platform variants when adding or moving a platform service.

Service Barrel

$lib/services/index.ts collects stable cross-platform capabilities:

typescript
export const services = {
	analytics: AnalyticsServiceLive,
	text: TextServiceLive,
	blobs: BlobsLive,
	blobSources: BlobSourcesLive,
	download: DownloadServiceLive,
	localShortcutManager: LocalShortcutManagerLive,
	sound: PlaySoundServiceLive,
} as const;

Do not force every provider implementation into this barrel. A runtime operation may import its provider-specific services directly when it owns the dispatch table.

Final Check

  • The service imports no UI or app-owned settings.
  • Every app choice enters as an explicit input or is selected by the caller.
  • Fallible public operations return Results; infallible operations stay plain.
  • A factory owns construction or lifecycle, not convention alone.
  • Platform choice happens through one #platform/* mapping.
  • Runtime provider choice happens once at the consuming operation.
  • Lower-layer errors pass through unless this service owns a new failure.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Services Layer AI skill do?

Apply Whispering service-boundary patterns for UI-free capabilities, explicit inputs, Result fallibility, Live objects, lifecycle factories, and platform variants. Use when creating or refactoring services, contracts, provider dispatch, or the `$lib/services` barrel.

Why use Services Layer on TypingMind?

Because you install it once and use it with any model. Services Layer 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 Services Layer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/EpicenterHQ/epicenter/tree/main/.agents/skills/services-layer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Services Layer?

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 Services Layer?

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

Is the Services Layer AI skill free?

It is published on GitHub by EpicenterHQ. Check the repository for licensing terms. 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 👇