本文へ移動
cccskills
無料GitHub で公開

composer-packages

Use when building or maintaining a Composer library — versioning, Laravel integration, autoloading, publishing to private registries — even when the user says 'release a new version'.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

composer-packages

When to use

Use this skill when creating, maintaining, or publishing Composer library packages — including Laravel packages with service providers, Artisan commands, and config publishing.

Procedure: Work with Composer packages

  1. Read the package's composer.json for structure and dependencies.
  2. Check if it's a Laravel package (look for extra.laravel.providers).
  3. Read the package's README.md and CHANGELOG.md.
  4. Check the agents/ directory in the package for package-specific docs.

Known packages

Check the project's composer.json for organization-specific packages. Check agents/overrides/skills/composer-packages.md for the package registry and known packages list.

Package structure

my-package/
├── src/                    # Source code
│   ├── App/
│   │   └── Providers/      # Laravel service providers
│   └── ...
├── config/                 # Publishable config files
├── tests/                  # Package tests
├── composer.json           # Package manifest
├── README.md               # Documentation
├── CHANGELOG.md            # Version history
└── agents/                 # Package-specific agent docs

composer.json essentials

Required fields

{
    "name": "vendor/my-package",
    "type": "library",
    "description": "Clear, concise description",
    "require": {
        "php": "^8.2"
    },
    "autoload": {
        "psr-4": {
            "Vendor\\MyPackage\\": "src/"
        }
    }
}

Laravel package auto-discovery

{
    "extra": {
        "laravel": {
            "providers": [
                "Vendor\\MyPackage\\App\\Providers\\PackageServiceProvider"
            ]
        }
    }
}

Composer scripts / plugins

Packages can hook into Composer lifecycle events:

{
    "scripts": {
        "post-install-cmd": [
            "MyNamespace\\ComposerScripts::onInstall"
        ]
    }
}

Version constraints

Use wide version ranges for library packages to maximize compatibility:

{
    "require": {
        "php": "^8.1 || ^8.2 || ^8.3 || ^8.4",
        "illuminate/support": "^10.0 || ^11.0 || ^12.0"
    }
}

Libraries should use || ranges. Applications should use ^ (caret).

Local development

Path repositories

In the consuming project's composer.json:

{
    "repositories": [
        { "type": "path", "url": "../packages/my-package" }
    ]
}

Then: composer require vendor/my-package:@dev

Development project

If the organization has a dedicated development sandbox for testing packages, use it for local testing.

Publishing

Private registry (GitHub Packages / Satis)

Packages are published to a private Composer registry. Check the organization's Satis or GitHub Packages setup.

Pre-publish checklist

  1. composer validate — verify composer.json is valid.
  2. composer dump-autoload — verify autoloading works.
  3. Run tests: vendor/bin/phpunit or vendor/bin/pest.
  4. Run quality tools: PHPStan, ECS, Rector.
  5. Update CHANGELOG.md with the new version.
  6. Tag the release: git tag v1.2.3.

Conventions

  • Follow the organization's namespace convention (check existing packages).
  • Use declare(strict_types=1) in all PHP files.
  • Use typed properties, parameters, and return types.
  • Follow the same coding standards as the main projects (see php-coder skill).
  • Include agents/ directory for package-specific documentation.

Output format

  1. Package files following standard Composer structure
  2. Updated composer.json with correct autoloading and dependencies
  3. Service provider and config publishing (if Laravel package)

Auto-trigger keywords

  • Composer package
  • library development
  • package versioning

Gotcha

  • Don't add composer.lock to library packages — it should be in .gitignore for libraries (not apps).
  • Minimum stability must be explicit — don't assume stable.
  • The model tends to set overly restrictive version constraints — use ^ (caret) not = (exact).

Do NOT

  • Do NOT use * version constraints in library packages.
  • Do NOT require specific patch versions — use ^ or || ranges.
  • Do NOT include dev dependencies in require — use require-dev.
  • Do NOT forget to run composer validate before publishing.
  • Do NOT publish without updating the changelog and tagging.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.

日本語の概要は準備中です。原文の説明を表示しています。

event4u-app/agent-config112026年10月12日 更新

event4u-app のスキルをすべて見る

このスキルの問題を報告する