Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add wesselgrift/sveltekit-spa --skill engineering-patternsgit clone --depth 1 https://github.com/wesselgrift/sveltekit-spaWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wesselgrift/sveltekit-spa/engineering-patterns)<a href="https://agentmods.dev/skills/wesselgrift/sveltekit-spa/engineering-patterns"><img src="https://agentmods.dev/badge/skills/wesselgrift/sveltekit-spa/engineering-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wesselgrift/sveltekit-spa/engineering-patterns"><img src="https://agentmods.dev/badge/skills/wesselgrift/sveltekit-spa/engineering-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00076 | $0.03767 |
| Opus 5 | $0.00038 | $0.01884 |
| Sonnet 5 | $0.00015 | $0.00753 |
| Haiku 4.5 | $0.00008 | $0.00377 |
Grade A, and why
engineering-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 447 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Engineering Patterns for SvelteKit
This project runs in SPA mode (ssr = false). All code executes in the browser — there are no server routes, server hooks, or server-side rendering.
SPA implications for pattern selection:
- Module-level singletons are safe (one user per tab, no cross-request leakage).
- Strategies wrap client-side SDKs or call external APIs/edge functions.
- Observer patterns use Svelte 5 runes; event buses are client-side only.
- Services and repositories run entirely in the browser via the Supabase client SDK.
- If the project ever migrates to SSR, re-evaluate Singleton and Observer patterns for per-request safety.
Composition flow — patterns layer in one direction:
Component → Service → Repository → Adapter (wraps SDK)
↑
Singleton (shared client)
Components call services. Services enforce business rules and call repositories. Repositories abstract data access. Adapters wrap third-party SDKs. Singletons provide shared client instances. Strategies and Factories are cross-cutting — used wherever swappable behavior or complex construction is needed.
============================================================
- Factory — centralized object creation ============================================================ Use a factory when constructing objects requires conditional logic, defaults, or async setup that callers should not repeat.
- Export a plain function (or async function) that returns a fully configured instance.
- Keep construction details hidden; callers receive a typed result.
- Prefer a factory over a class constructor when multiple creation paths exist.
- For costly async setup (remote config, auth token exchange), await the factory once at init time and reuse the result.
// src/lib/api/create-api-client.ts
import type { ApiClient } from './types';
// Async factory — resolves auth headers before returning a ready client.
export async function createApiClient(baseUrl: string): Promise<ApiClient> {
const token = await fetchServiceToken();
const headers = { Authorization: `Bearer ${token}` };
return {
get: async (path) => fetch(`${baseUrl}${path}`, { headers }).then((r) => r.json()),
post: async (path, body) =>
fetch(`${baseUrl}${path}`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}).then((r) => r.json()),
};
}
Avoid:
- Scattering construction logic across multiple call sites — centralize it in the factory.
- Returning partially initialized objects — the factory's output must be ready to use.
============================================================ 2) Repository — data access abstraction
Encapsulate all Supabase table operations behind a repository interface so business logic never depends on Supabase directly.
- Define an interface describing the data operations (find, create, update, delete).
- Implement with Supabase queries; export the concrete implementation as the default.
- For tests, provide a mock factory that satisfies the same interface with in-memory storage.
- Place repositories in
src/lib/database/repositories/. - Select only the columns you need — avoid
select('*'). - Let Supabase errors propagate — the service layer is responsible for catching and transforming them.
// src/lib/database/repositories/types.ts
export interface ProjectRepository {
findById(id: string): Promise<Project | null>;
findByOwner(ownerId: string): Promise<Project[]>;
create(data: CreateProjectInput): Promise<Project>;
update(id: string, data: UpdateProjectInput): Promise<Project>;
remove(id: string): Promise<void>;
}
// src/lib/database/repositories/project-repository.ts
import { supabase } from '$lib/supabase/client';
import type { ProjectRepository } from './types';
export const projectRepository: ProjectRepository = {
async findById(id) {
const { data, error } = await supabase
.from('projects')
.select('id, name, owner_id, created_at')
.eq('id', id)
.maybeSingle();
if (error) throw error;
return data;
},
// ... remaining methods follow the same shape
};
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 447 lines · 76 tokens per session scan A a83695f748ae
engineering-patterns is a skill published in the GitHub repository wesselgrift/sveltekit-spa (37 stars, last pushed 7d ago), licensed MIT. It adds 76 tokens to every session and 3,767 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-11.
Other skills, from other repositories
shadcn-vue
Manages shadcn-vue components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn-vue, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for…
shadcn-svelte
Manages shadcn-svelte components and projects — adding, updating, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn-svelte, the CLI, design-system presets, or any project with a components.json file. Also triggers for…
tanstack-form
Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, Lit, and Svelte.
nuxt-data-audit
An audit guide for checking how Nuxt projects load data and whether their data-fetching patterns follow the project's performance rules.
nuxt-content
Build typed, content-driven Nuxt applications with @nuxt/content. Use when working with content.config.ts, collections, queryCollection, Markdown or MDC rendering, content databases, hooks, custom sources, search, or Content v2 migrations.
nuxt-modules
Use when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6) Setting up CI/CD workflows for modules.…