lovable-boilerplate lib.instructions.md

Instructions for organizing shared utilities, TypeScript type definitions, constants, validation schemas, and API service functions under `src/lib/`.

In plain words
What is it for?
Use them when adding utility functions, shared interfaces, Zod validation schemas, API clients, or services for application data.
Why use it?
They give common code a predictable home and keep API calls, validation, and shared data shapes from being duplicated across components.

Instructions file for GitHub Copilot

Install

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.

agentmods
npx agentmods add instructions/chihebnabil/lovable-boilerplate/lib
Clone the repo
git clone --depth 1 https://github.com/chihebnabil/lovable-boilerplate

Made for: GitHub Copilot.

Per session 609 This file is loaded in full into every session.
When invoked 609 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00609 $0.00609
Opus 5 $0.00304 $0.00304
Sonnet 5 $0.00122 $0.00122
Haiku 4.5 $0.00061 $0.00061

Measured 2d ago against content hash ce1fccf5a9a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lovable-boilerplate lib.instructions.md 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 2d 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.

.github/instructions/lib.instructions.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Utility & Service Guidelines

LIB ORGANIZATION RULES

File Structure

src/lib/
├── utils.ts          # General utilities (keep existing cn function)
├── types.ts          # Shared TypeScript interfaces
├── constants.ts      # App-wide constants
├── validations/      # Zod schemas
│   ├── user.ts
│   ├── product.ts
│   └── common.ts
└── services/         # API service layer
    ├── api.ts        # Base API client
    ├── userService.ts
    └── productService.ts

Utility Functions (utils.ts)

// Keep existing cn function
export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}

// Add other utilities
export function formatDate(date: Date | string): string {
  return new Intl.DateTimeFormat('en-US').format(new Date(date))
}

export function debounce<T extends (...args: any[]) => any>(
  func: T,
  wait: number
): (...args: Parameters<T>) => void {
  let timeout: NodeJS.Timeout
  return (...args: Parameters<T>) => {
    clearTimeout(timeout)
    timeout = setTimeout(() => func(...args), wait)
  }
}

Type Definitions (types.ts)

// Shared application types
export interface User {
  id: string
  email: string
  name: string
  avatar?: string
  role: UserRole
}

export interface ApiResponse<T> {
  data: T
  message: string
  success: boolean
}

export type UserRole = 'admin' | 'user' | 'guest'
export type Theme = 'light' | 'dark' | 'system'

Constants (constants.ts)

// Application constants
export const API_ENDPOINTS = {
  USERS: '/api/users',
  PRODUCTS: '/api/products',
  AUTH: '/api/auth',
} as const

export const QUERY_KEYS = {
  USERS: 'users',
  PRODUCTS: 'products',
  USER_PROFILE: 'user-profile',
} as const

export const ROUTES = {
  HOME: '/',
  DASHBOARD: '/dashboard',
  USERS: '/users',
  PROFILE: '/profile',
} as const

Validation Schemas (validations/)

// validations/common.ts
export const emailSchema = z.string().email('Invalid email')
export const phoneSchema = z.string().regex(/^\+?[\d\s-()]+$/, 'Invalid phone')

// validations/user.ts
export const userSchema = z.object({
  name: z.string().min(2, 'Name too short'),
  email: emailSchema,
  phone: phoneSchema.optional(),
})

export type UserFormData = z.infer<typeof userSchema>

Read the full file on GitHub · 107 lines

Changes

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.

  1. 2d ago First seen · 107 lines · 609 tokens per session scan A ce1fccf5a9a1

Subscribe to this mod's changes

lovable-boilerplate lib.instructions.md is an instructions file published in the GitHub repository chihebnabil/lovable-boilerplate (65 stars, last pushed 1mo ago), licensed MIT. It adds 609 tokens to every session, about $0.0030 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-08-30.

Related

Other instructions, from other repositories

claude-task-master CLAUDE.md

Claude Code instructions for eyaltoledano/claude-task-master, covering claude code instructions, task master ai instructions, test guidelines, test file placement and synchronous tests.

eyaltoledano/claude-task-master · 1,815 tokens

oh-my-copilot AGENTS.md

Instructions for RobinNorberg/oh-my-copilot, covering oh-my-copilot - intelligent multi-agent orchestration and setup.

RobinNorberg/oh-my-copilot · 5,150 tokens

oh-my-copilot CLAUDE.md

Instructions for RobinNorberg/oh-my-copilot, covering development guidelines, branch strategy, pr creation and commit convention.

RobinNorberg/oh-my-copilot · 120 tokens

DevoxxGenieIDEAPlugin GEMINI.md

Instructions for devoxx/DevoxxGenieIDEAPlugin, a project described as: DevoxxGenie is an agentic plugin for IntelliJ IDEA that uses local LLM's (Ollama, LMStudio, GPT4All, Jan and Llama.cpp) and Cloud based LLMs to help review, test, explain your project code. Latest version now also supports Spec Driven Development…

devoxx/DevoxxGenieIDEAPlugin · 257 tokens

agent-rules child-process.instructions.md

Instructions for lirantal/agent-rules, covering system processes secure coding guidelines, your mission and spawning system processes.

lirantal/agent-rules · 196 tokens

rosetta command-versions-vs-presence.instructions.md

Instructions for tikoci/rosetta, a project described as: MCP Server with RouterOS docs + commands + products + changelogs, using SQLite-as-RAG, sourced from MikroTik.

tikoci/rosetta · 141 tokens