dependency-management
Skill4 starsChanged 4 months agoMITView on GitHub
Declare, constrain, and update PHP dependencies with Composer — require vs require-dev, semantic version constraints, install vs update, and the lock file. Use when the user wants to add, remove, or upgrade a third-party PHP package in a project managed by Composer; the user needs to pick or tighten a version constraint (caret, tilde, or exact) for a dependency; the user needs a reproducible, locked dependency set for CI or production deployment. Keywords: composer, dependencies, version-constraints, lock-file, semver.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- kinhluan/skillstheir own version, first seen Nov 8, 2026
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- KMaruthi2002/universal-llm-skillstheir own version, first seen Oct 25, 2026
- SwastikPandey1024/agentic-engineering-ostheir own version, first seen Oct 20, 2026
- Mushfiqur-Rahman-Robin/coding-rulestheir own version, first seen Oct 13, 2026
Used with
Projects with it also use infrastructure-as-code, release-management and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
mmondoraSkillinfrastructure-as-code
Infrastructure as Code with Terraform and Pulumi. State management, modularity, drift detection, secrets handling. Use when provisioning cloud resources, writing Terraform/Pulumi modules, or managing infrastructure configuration.
Also in 4 projects that use this
Microsoft AzureSkillrelease-management
Prepares and validates AI Landing Zone semantic releases. Use for changelog entries, manifest versions, release branches, tags, GitHub Releases, and post-release branch reconciliation.
Also in 4 projects that use this
barisariburnuSkillperformance-optimization
Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.
Also in 6 projects that use this
MicrosoftSkilldeployment
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 4 projects that use this
wrsmith108Skilldocker
Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- derHaken/SuperAntigravity★ 439same name
- REPOZY/superpowers-optimized★ 146same name
- robisson/build-like-amazon-agent-skills★ 16same name
- kinhluan/skills★ 6same name
- dprakash2101/dotnet-production-agent-skills★ 4same name
- saitarrun/Devforge-ai★ 4same name
- bchox/agent-practices★ 2same name
- JhonatanMota/claude-skills★ 1same name
- KMaruthi2002/universal-llm-skills★ 1same name
- michaelsvanbeek/personal-agent-skills★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository119 other files it gives its agents.
- strategy-bitrix-d7-incrementalSkill
- strategy-explicit-over-magicSkill
- strategy-framework-conventionsSkill
- strategy-legacy-safe-editsSkill
- strategy-minimal-diffSkill
- strategy-no-untested-refactorSkill
- strategy-preserve-public-apiSkill
- strategy-readonly-immutabilitySkill
- strategy-security-firstSkill
- strategy-test-drivenSkill
- openapiSkill
- paginationSkill
- rest-designSkill
- versioningSkill
- cqrsSkill
- dependency-inversionSkill
- hexagonalSkill
- repository-patternSkill
- service-layerSkill
- bitrixSkill
- findings-reportSkill
- laravelSkill
- performanceSkill
- phpSkill
- project-analysisSkill
- refactoringSkill
- roi-prioritizationSkill
- securitySkill
- stack-detectionSkill
- cache-layersSkill
- component-engineSkill
- d7-eventsSkill
- d7-loaderSkill
- d7-orm-queriesSkill
- iblock-elementsSkill
- kernel-main-moduleSkill
- localizationSkill
- controllersSkill
- ormSkill
- validationSkill
- controllersSkill
- query-builderSkill
- routingSkill
- autoload-psr4Skill
- scriptsSkill
- connection-poolingSkill
- mysql-indexingSkill
- redisSkill
- transactionsSkill
- ci-github-actionsSkill
- deployment-strategiesSkill
- docker-phpSkill
- env-configSkill
- associationsSkill
- entities-mappingSkill
- orm-basicsSkill
- entity-apiSkill
- module-developmentSkill
- routing-controllersSkill
- formsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Do not use Composer to load optional feature modules or plugins that must be enabled or disabled at runtime.
- Distinctive: line 63
Do not use this skill to patch or hand-edit files under vendor/.
- Very specific: line 78
Run composer require vendor/package:^2.3 to add the package and record a caret constraint in composer.json.
- Very specific: line 80
Commit both composer.json and the regenerated composer.lock so the exact resolved versions are shared with the team.
- Very specific: line 87
Run composer audit in CI to fail the build when a required package has a known security advisory, and keep constraints loose enough to …
- Distinctive: line 116
Not applicable — no I/O, auth, or untrusted input.
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- generated: do not edit — source: knowledge/atoms/composer/dependency-management/ --><!-- schema: atomVersion=3 skillVersion=2 graphVersion=1 --><!-- compile: @php-skills/compiler v1.0.0 (deterministic build) -->Composer Dependency Management
When to use
- The user wants to add, remove, or upgrade a third-party PHP package in a project managed by Composer.
- The user needs to pick or tighten a version constraint (caret, tilde, or exact) for a dependency.
- The user needs a reproducible, locked dependency set for CI or production deployment.
When NOT to use
- Do not use Composer to load optional feature modules or plugins that must be enabled or disabled at runtime.
- Do not use this skill to patch or hand-edit files under vendor/; that directory is regenerated on every install.
Core guidance
- Prefer caret constraints for semver libraries — Use a caret constraint (
^2.3) for libraries that follow semantic versioning so Composer accepts compatible minor and patch releases but never a breaking major. - Commit the lock file for applications — Commit
composer.lockfor applications so every developer and every environment installs identical versions; do not commit it for a reusable library you publish. - Use install to reproduce, update to change versions — Run
composer installto reproduce the exact versions incomposer.lock, and runcomposer updateonly when you intend to resolve new versions and rewrite the lock. - Split runtime and development dependencies — Put packages the application needs at runtime under
require, and tools only used while developing or testing (PHPUnit, PHPStan, fixtures) underrequire-dev.
Quick recipe
- Run
composer require vendor/package:^2.3to add the package and record a caret constraint in composer.json. (verify:composer.jsonlistsvendor/packageunderrequirewith a caret constraint) - Commit both composer.json and the regenerated composer.lock so the exact resolved
versions are shared with the team. (verify:
git statusshows both composer.json and composer.lock staged together) - In CI and on deploy, run
composer install --no-devso the exact locked versions are restored without dev tooling. (verify: The CI install resolves the same versions as the committed lock and exits 0)
Best practices
- Run
composer auditin CI to fail the build when a required package has a known security advisory, and keep constraints loose enough to absorb patch releases - Declare the PHP version and required extensions in
require(for example"php": ">=8.1"and"ext-json": "*") instead of relying on the developer's local environment
Anti-patterns
| Anti-pattern | Why it fails | Do instead |
| Committing the vendor directory to version control | It bloats history, causes merge conflicts, and hides the lock file as the real source of truth for dependency versions. | Gitignore vendor/, commit composer.lock, and rebuild vendor with composer install in CI and on deploy. |
| Putting development tooling in require | They ship to production, enlarging the deployed artifact and its attack surface, and they slow the production install. | Move all development-only tools to require-dev and deploy with composer install --no-dev. |
| Pinning every constraint to an exact version | Exact pins block patch-level security fixes and force a manual constraint edit for<br>every update; the lock file already gives reproducibility without freezing the<br>constraint. | Use caret constraints in composer.json and rely on committed composer.lock for reproducible installs. |
See references/anti-patterns.md.
Common mistakes
- Editing composer.json without updating the lock — Hand-editing a constraint in composer.json without running an update leaves the lock file out of sync. Fix: After changing a constraint, run
composer update vendor/packageto re-resolve just that package and refresh the lock. - Running composer update during deployment — Running
composer updateon the deploy host re-resolves versions and can ship untested code to production. Fix: Deploy withcomposer install --no-devagainst the committed lock, and runupdateonly in a reviewed pull request. - Using a wildcard or unbounded constraint — A wildcard constraint like
"*"or">=1.0"lets Composer pull a breaking major version without warning. Fix: Pin the major with a caret (^1.0) so patch and minor releases flow in but breaking majors are blocked.
Version notes
- Composer 2 tightens platform checks (PHP >=7.4) — Composer 2 enforces platform requirements more strictly and resolves dependencies faster than Composer 1; some Composer 1 plugins are incompatible.
Security
- Not applicable — no I/O, auth, or untrusted input.
Testing
- Activation and decision behavior are verified in
eval/scenarios/composer/dependency-management.yaml.
Additional resources
- references/anti-patterns.md
- references/core.md
- references/examples.md
- references/pitfalls.md
- references/recipes.md
- references/version-differences.md
Knowledge graph
Related: composer/autoload-psr4, composer/scripts
<!-- graph-fragment: graph/fragments/composer/dependency-management.yaml -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

