Agent skill

Medialibrary Development

by gdarko in gdarko/laravel-vue-starter

Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving…

MITAuto-check passedBackend & APIs

Install Medialibrary Development

skills CLI
$ npx skills add gdarko/laravel-vue-starter --skill medialibrary-development -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gdarko/laravel-vue-starter medialibrary-development --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gdarko/laravel-vue-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.junie/skills/medialibrary-development .claude/skills/medialibrary-development && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
medialibrary-development
GitHub stars
145
Used in
3 other repos
Token cost
~880 tokens
SKILL.md length
254 words
Files
2 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving…

  • Works in 3 steps: Identify the task (model setup, adding… → Read references/medialibrary-guide.md… → Apply the patterns from the reference,…
  • Tasks that involve Backend development
  • SKILL.md covers Overview, When to Activate, Scope and Workflow, plus 3 more sections
  • Calls php

What it does

Medialibrary Development is an agent skill from gdarko/laravel-vue-starter. Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/medialibrary-guide.md`).

It sits in Backend & APIs, covering Backend development. It works with Laravel, Vue.js, Tailwind CSS and Vite. The repository describes itself as: AI-native Laravel/Vue boilerplate. Tailwind + DaisyUI, Sanctum, Fortify, Pinia. Built-in agent skills for Claude Code, Cursor, Copilot, Gemini & Junie. The licence is MIT.

When your agent uses it

  • Tasks that involve Backend development

Example prompts

  • “/medialibrary-development”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Identify the task (model setup, adding media, defining conversions, retrieving files, etc.).
  2. Read references/medialibrary-guide.md and focus on the relevant section.
  3. Apply the patterns from the reference, keeping code minimal and Laravel-native.

What it can do on your machine

Read from SKILL.md and the folder at commit 2b8eb53. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • php

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Medialibrary Development loads about 880 tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 61 tokens; SKILL.md has 254 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~880
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gdarko/laravel-vue-starter at commit 2b8eb53, republished under its MIT licence (© gdarko). 254 words, ~880 tokens.

Download SKILL.mdSave it as .claude/skills/medialibrary-development/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
medialibrary-development
description
Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.
license
MIT
metadata.author
Spatie

Media Library Development

Overview

Use spatie/laravel-medialibrary to associate files with Eloquent models. Supports image/video conversions, responsive images, multiple collections, and various storage disks.

When to Activate

  • Activate when working with file uploads, media attachments, or image processing in Laravel.
  • Activate when code references HasMedia, InteractsWithMedia, the Media model, or media collections/conversions.
  • Activate when the user wants to add, retrieve, convert, or manage files attached to Eloquent models.

Scope

  • In scope: media uploads, collections, conversions, responsive images, custom properties, file retrieval, path/URL generation.
  • Out of scope: general file storage without Eloquent association, non-Laravel frameworks.

Workflow

  1. Identify the task (model setup, adding media, defining conversions, retrieving files, etc.).
  2. Read references/medialibrary-guide.md and focus on the relevant section.
  3. Apply the patterns from the reference, keeping code minimal and Laravel-native.

Core Concepts

Model Setup

Every model that should have media must implement HasMedia and use the InteractsWithMedia trait:

php
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

class BlogPost extends Model implements HasMedia
{
    use InteractsWithMedia;
}
Adding Media
php
$blogPost->addMedia($file)->toMediaCollection('images');
$blogPost->addMediaFromUrl($url)->toMediaCollection('images');
$blogPost->addMediaFromRequest('file')->toMediaCollection('images');
Defining Collections
php
public function registerMediaCollections(): void
{
    $this->addMediaCollection('avatar')->singleFile();
    $this->addMediaCollection('downloads')->useDisk('s3');
}
Defining Conversions
php
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Image\Enums\Fit;

public function registerMediaConversions(?Media $media = null): void
{
    $this->addMediaConversion('thumb')
        ->fit(Fit::Contain, 300, 300)
        ->nonQueued();
}
Retrieving Media
php
$url = $model->getFirstMediaUrl('images');
$thumbUrl = $model->getFirstMediaUrl('images', 'thumb');
$allMedia = $model->getMedia('images');

Do and Don't

Do:

  • Always implement the HasMedia interface alongside the InteractsWithMedia trait.
  • Use ?Media $media = null as the parameter for registerMediaConversions().
  • Call ->toMediaCollection() to finalize adding media.
  • Use ->nonQueued() for conversions that should run synchronously.
  • Use ->singleFile() on collections that should only hold one file.
  • Use Spatie\Image\Enums\Fit enum values for fit methods.

Don't:

  • Don't forget to run php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations" before migrating.
  • Don't use env() for disk configuration; use config() or set it in config/media-library.php.
  • Don't call addMedia() without calling toMediaCollection() — the media won't be saved.
  • Don't reference conversion names that aren't registered in registerMediaConversions().

References

  • references/medialibrary-guide.md

© gdarko, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .junie/skills/medialibrary-development of gdarko/laravel-vue-starter.

  • SKILL.md
  • references/medialibrary-guide.md

Open the folder on GitHubat commit 2b8eb53

Used in 3 other repositories

We found 9 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in gdarko/laravel-vue-starter, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Medialibrary Development next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Medialibrary Development compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Medialibrary Development this skillgdarko/laravel-vue-starter1453 repos~880Automated safety check: PassMIT
Wayfinder Developmentslimani-dev/muraqib1291 repos~622Automated safety check: PassMIT
Livewire Developmentcoollabsio/coolify63k—~964Automated safety check: PassMIT
Livewire Developmentyungifez/skuul4091 repos~1.9kAutomated safety check: PassMIT
Configure Nightwatchtrypostit/trypost685—~2.7kAutomated safety check: PassMIT
Passport Developmenttrypostit/trypost685—~1.9kAutomated safety check: PassMIT

Similar skills

  • Wayfinder Development

    slimani-dev/muraqib

    A skill your agent uses for Laravel Wayfinder which auto-generates typed functions for Laravel controllers and routes.

    129 GitHub starsUsed in 1 repo~622 tokens
    Backend & APIsAuto-check passed
  • Livewire Development

    coollabsio/coolify

    A skill your agent uses for any task or question involving Livewire.

    63k GitHub stars~964 tokensUpdated today
    Backend & APIsAuto-check passed
  • Livewire Development

    yungifez/skuul

    A skill your agent uses for any task or question involving Livewire.

    409 GitHub starsUsed in 1 repo~1.9k tokens
    Backend & APIsAuto-check passed
  • Configure Nightwatch

    trypostit/trypost

    Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies.

    685 GitHub stars~2.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Passport Development

    trypostit/trypost

    Develops OAuth2 API authentication with Laravel Passport. An agent skill from trypostit/trypost.

    685 GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • New Component

    developermithu/tallcraftui

    Add a new TallCraftUI Blade component end-to-end (class with inline template, color/size traits, config defaults, provider registration, docs reminder).

    169 GitHub stars~581 tokensUpdated 6 days ago
    Backend & APIsAuto-check passed

More from gdarko/laravel-vue-starter

  • Spa Auth Development

    gdarko/laravel-vue-starter

    Activate when working on SPA authentication flow, Sanctum cookie-based auth, Vue Router guards, auth store, login/register/password reset pages, or CORS/session configuration.

    145 GitHub stars~668 tokensUpdated 6 mo ago
    Auto-check: notes
  • Vue Component Development

    gdarko/laravel-vue-starter

    Activate when creating or modifying Vue 3 components, pages, layouts, stores, or services in the frontend.

    145 GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about Medialibrary Development

What does Medialibrary Development do?

Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving…. Medialibrary Development is an agent skill from gdarko/laravel-vue-starter. Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.

When should I use Medialibrary Development?

Medialibrary Development fits situations like: tasks that involve Backend development.

How do I install Medialibrary Development in Claude Code?

Run `npx skills add gdarko/laravel-vue-starter --skill medialibrary-development -a claude-code`. Or copy the skill folder (.junie/skills/medialibrary-development in gdarko/laravel-vue-starter) into .claude/skills/medialibrary-development in your project. Claude Code loads it when a task matches its description.

How do I install Medialibrary Development in Codex?

Run `npx skills add gdarko/laravel-vue-starter --skill medialibrary-development -a codex`. Or copy the skill folder (.junie/skills/medialibrary-development in gdarko/laravel-vue-starter) into .agents/skills/medialibrary-development in your project. Codex loads it when a task matches its description.

Can I use Medialibrary Development in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gdarko/laravel-vue-starter --skill medialibrary-development -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/medialibrary-development, .gemini/skills/medialibrary-development, .github/skills/medialibrary-development and .opencode/skills/medialibrary-development in your project.

What does Medialibrary Development need to run?

Going by SKILL.md and its folder, Medialibrary Development needs the command-line tools its instructions call (php).

Does Medialibrary Development access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Medialibrary Development safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Medialibrary Development use?

Medialibrary Development is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Medialibrary Development use?

About 880 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.7k tokens, read only when the agent opens those files.

What are the alternatives to Medialibrary Development?

Skills that share tags, products or a category with Medialibrary Development: Wayfinder Development (slimani-dev/muraqib, 129 stars), Livewire Development (coollabsio/coolify, 63k stars), Livewire Development (yungifez/skuul, 409 stars) and Configure Nightwatch (trypostit/trypost, 685 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Medialibrary Development?

gdarko (a GitHub user) maintains it in gdarko/laravel-vue-starter, which has 145 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on April 1, 2026.

Source: gdarko/laravel-vue-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.