home / skills / noartem / skills / laravel-dependencies-trim-packages

laravel-dependencies-trim-packages skill

/skills/laravel-dependencies-trim-packages

This skill helps prune Laravel dependencies by auditing composer packages, removing unused ones, and prioritizing built-in features to improve boot time and

npx playbooks add skill noartem/skills --skill laravel-dependencies-trim-packages

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
417 B
---
name: laravel-dependencies-trim-packages
description: Remove unneeded Composer packages and assets to improve boot time, memory, and security surface
---

# Trim Dependencies

- Audit packages: `composer show --tree` and remove unused ones
- Prefer first-party or built-in features before adding new packages
- Regularly update; pin major versions via constraints and test

```
composer remove vendor/package
```

Overview

This skill helps Laravel projects trim unneeded Composer packages and related assets to improve boot time, reduce memory use, and shrink the security attack surface. It provides guided checks and concrete removal actions so you can keep dependencies minimal and maintainable. The focus is practical: audit, decide, remove, and test safely.

How this skill works

The skill inspects the Composer dependency tree and identifies packages that are likely unused or redundant compared to first-party framework features. It suggests candidates for removal and gives the exact composer remove command plus follow-up steps to clean assets and config. It also recommends version pinning and testing patterns to avoid regressions.

When to use it

  • Before releases when optimizing performance or memory footprint
  • When boot time or worker memory is higher than expected
  • After major refactors that replace package functionality with built-in features
  • During security reviews to reduce exposed code and attack surface
  • When dependency count grows and maintenance burden increases

Best practices

  • Prefer first-party and built-in Laravel features before adding packages
  • Run composer show --tree to understand dependency relationships before removing anything
  • Pin major versions with constraints and run your test suite after changes
  • Remove associated published assets, config, and migrations that packages added
  • Perform removals in a feature branch and deploy to staging to validate runtime behavior

Example use cases

  • Remove a third-party auth or helper package after adopting Laravel’s native features to reduce boot time
  • Trim unused dev dependencies in CI workers to save memory and speed up pipelines
  • Eliminate abandoned or vulnerable packages found in a security audit to lower risk
  • Consolidate overlapping packages (e.g., two date libraries) by keeping the one you actively use and removing the other

FAQ

How do I safely identify unused packages?

Start with composer show --tree to see usage relationships, search your codebase for namespaces and service provider registrations, and run tests after removal in a branch or staging environment.

What commands remove packages and their assets?

Use composer remove vendor/package to uninstall the package, then remove any published config/assets and run composer install and your app’s cache/compile commands to ensure a clean state.