Composer Setup for Skills
Contents
- When to Add composer.json
- composer.json Structure
- Multi-Skill Packages
- Publishing to Packagist
- Skill repos that ship their own PHP code
- Files to NOT Include
- Validation
- Integration with Plugin
- Troubleshooting
Guide for adding Composer distribution to Netresearch skills.
When to Add composer.json
Add composer.json to ALL skills EXCEPT those explicitly targeting non-PHP ecosystems.
| Skill Type | composer.json |
|---|---|
| PHP/TYPO3 skills | Required |
| General skills | Required |
| Go-specific skills | Not needed |
| Rust-specific skills | Not needed |
composer.json Structure
Basic Structure
{
"name": "netresearch/{skill-name}-skill",
"description": "{Skill description from SKILL.md}",
"type": "ai-agent-skill",
"license": "(MIT AND CC-BY-SA-4.0)",
"authors": [
{
"name": "Netresearch DTT GmbH",
"email": "plugins@netresearch.de",
"homepage": "https://www.netresearch.de/",
"role": "Manufacturer"
}
],
"require": {
"netresearch/composer-agent-skill-plugin": "*"
},
"extra": {
"ai-agent-skill": "SKILL.md"
}
}Key Fields
| Field | Value | Purpose |
|---|---|---|
name |
netresearch/{repo-name} |
Must match GitHub repo name exactly |
type |
ai-agent-skill |
Enables plugin discovery |
require |
composer-agent-skill-plugin |
Plugin dependency |
extra.ai-agent-skill |
Path to SKILL.md | Skill location |
Package Naming Convention
- Rule: composer name = GitHub repo name (
netresearch/{repo-name}) - All skill repos are named
*-skillon GitHub - Examples:
- Repo
netresearch/typo3-docs-skill→ composer namenetresearch/typo3-docs-skill - Repo
netresearch/jira-skill→ composer namenetresearch/jira-skill
- Repo
Multi-Skill Packages
For packages containing multiple skills:
{
"name": "netresearch/{name}-skill",
"type": "ai-agent-skill",
"extra": {
"ai-agent-skill": [
"skills/skill-one/SKILL.md",
"skills/skill-two/SKILL.md"
]
}
}Example: jira-skill
{
"name": "netresearch/jira-skill",
"extra": {
"ai-agent-skill": [
"skills/jira-communication/SKILL.md",
"skills/jira-syntax/SKILL.md"
]
}
}Publishing to Packagist
Prerequisites
- GitHub repository is public
- composer.json is valid
- Packagist account linked to GitHub
Steps
Create version tag:
git tag v1.0.0 git push --tagsRegister on Packagist:
- Go to https://packagist.org/packages/submit
- Enter repository URL
- Submit
Check the auto-update webhook. When the Packagist account is linked to GitHub and the Packagist GitHub application has access to the organization, submitting the package makes Packagist create a repository webhook to
https://packagist.org/api/githubitself; its latest delivery in the repository's webhook settings answers 202. Only when no such hook exists, add one by hand with the values from https://packagist.org/about#how-to-update-packages: payload URLhttps://packagist.org/api/github?username=<Packagist username>, content typejson, the push event only, the account's API token as the secret. Without?username=the hook answers 403 on every push, and Packagist keeps the state of its last crawl, so no later tag reachescomposer require. Do not add a second hook next to a working one.For
netresearch/*packages the Packagist username isnetresearch: that account is a maintainer of every-skillpackage under the vendor (41 of 41 on 2026-11-04, two of them shared with a second maintainer). Read it per package fromhttps://packagist.org/packages/<vendor>/<name>.json→.package.maintainers[].namebefore using it: a package submitted from another account lists that account, and its hook needs that username. Wherenetresearchis listed, the hand-made payload URL ishttps://packagist.org/api/github?username=netresearch, and the main API token forcreate-packagebelow is the one on that account's profile page.
The API alternative to the submit form is POST https://packagist.org/api/create-package with the body {"repository": "https://github.com/<org>/<repo>"}, Content-Type: application/json and Authorization: Bearer <username>:<main API token>. It answers 202, and the first crawl followed within a minute when this was done for the skill repos. The Packagist API documentation marks the endpoint as requiring the main token; the safe token is not enough.
Every API call and the webhook need only the token, never a login: create-package takes the main token, api/update-package either token. A browser login is needed only to read the token the first time or after a rotation. On 2026-10-18 a login with plain HTTP requests got past the password and failed the two-factor POST to /2fa-check with HTTP 400, while a headless Playwright login worked; neither was re-tested since. The forms involved, read from the live login page and the upstream templates on 2026-11-08: the password form is #page_login (fields _username, _password; its submit button carries the recaptcha-protected class), the two-factor form at /2fa takes the TOTP code in input[name=_auth_code] and carries a hidden CSRF field, and on /profile/ the token is not in the value of the field but in its data-api-token attribute: the first input.api-token holds the main token, the second the safe token. Take the password, the TOTP secret and the token from the team's secret store through environment variables, never as command-line arguments.
Check the result where Composer looks, not on the package page: https://repo.packagist.org/p2/<vendor>/<name>.json answers 404 for a name Composer cannot install. The reusable release.yml runs that check after every release and fails on 404.
Renaming the package
Changing name in composer.json does not rename anything on Packagist. Packagist keeps the package under the name it was submitted with and publishes every later tag there, so the new name answers 404 and composer require <new name> fails with "Could not find a matching version of package". Until 2026-10-18 none of the 39 Netresearch skill repos was installable under its composer.json name: 16 were on Packagist only under an older name (agent-*, agents-skill), and 23 had never been submitted.
A rename therefore takes three steps:
- Keep
"replace": {"<old name>": "self.version"}incomposer.json. When a project requires the new name and something in its tree still requires the old one, the new package satisfies both and is installed once, instead of two copies of the same skill.self.versionmakes the old name available only at the new package's own version, so this works while the old constraint (for example^2.20) accepts that version; a constraint the new versions do not meet has to be updated. A project that requires only the old name keeps installing the old package. The entry names the old package, never the package's own name: Packagist rejects every tag whosereplacelists the package itself (a package cannot set a replace on itself). The rejected tags stay rejected, so a correctedcomposer.jsonreaches Packagist only with a new tag. The maintainer mail "failed to update due to invalid data" is sent only for an invalid branch: Composer'sVcsRepositorysetsbranchErrorOccurredin its branch loop, never for a skipped tag. After the fix, every remote branch that still carries the oldcomposer.jsonkeeps the mail coming until it is rebased or deleted; check them withcomposer validateon each branch's file. TheComposer schemastep of the sharedvalidate.ymlrunscomposer validateand fails on this entry. - Submit the repository again, through the form or
create-packageabove. Packagist reads the new name fromcomposer.jsonand creates a second package for the same repository. - Mark the old package abandoned with the new name as its replacement (
https://packagist.org/packages/<old name>/abandon, replacement fieldpackage[replacement]). Composer then prints the replacement to anyone who still installs the old name.
Skill repos that ship their own PHP code
A skill repo with its own src/, bin/ and dependencies runs composer install in its own root, locally and in CI. That activates netresearch/composer-agent-skill-plugin on the skill repo itself, and the plugin registers the repo as a skill inside itself:
extra.ai-agent-skillis rewritten from the string path into an object ({"skills": [...], "allow-skills": []}).validate-skill.shthen fails withcomposer.json extra.ai-agent-skill could not be parsed.- A
<skills_system>block is appended toAGENTS.md. composer.json.skill-trust.lockappears next tocomposer.json.
Deny the plugin in the repo's own config. The package is the skill and has nothing to install into itself. Consumers are unaffected — allow-plugins applies to the root package, so an installing project decides for itself:
{
"config": {
"allow-plugins": {
"netresearch/composer-agent-skill-plugin": false
}
}
}The field is not optional once the repo has dependencies of its own: without an entry, a non-interactive composer install exits 1 with blocked by your allow-plugins config instead of prompting.
Cover the artefacts in .gitignore:
/vendor/
/composer.lock
composer.json.skill-trust.lockFiles to NOT Include
Never add these to skill repos:
composer.lock- Locks are for applications, not librariesvendor/- Dependencies installed by users
A path can be kept out of the Composer dist with export-ignore in .gitattributes: Packagist serves a tag's GitHub zipball, which git archive builds. The same attribute applies to every other git archive of that tree, so search the repo before adding it, CI workflows included (rg --hidden -g '!.git' 'git archive|"archive"'). On 2026-11-18 /benchmarks export-ignore in php-ast-edit-skill would have emptied the snapshot its benchmark harness builds with git archive HEAD benchmarks/… (0 of 23 files), and the change was dropped.
Validation
Check composer.json validity:
# Syntax check
composer validate
# Check type
grep '"type"' composer.json | grep "ai-agent-skill"
# Check plugin requirement
grep "composer-agent-skill-plugin" composer.jsonIntegration with Plugin
The composer-agent-skill-plugin automatically:
- Discovers installed
ai-agent-skillpackages - Parses SKILL.md frontmatter
- Generates AGENTS.md index
- Provides
composer list-skillscommand - Provides
composer read-skill {name}command
Troubleshooting
"Package not found"
- Ensure package is published on Packagist
- Check package name matches exactly
- Run
composer clear-cache
"Plugin not activated"
When prompted, allow the plugin:
Do you trust "netresearch/composer-agent-skill-plugin"? [y,n,d,?]Or pre-authorize in composer.json:
{
"config": {
"allow-plugins": {
"netresearch/composer-agent-skill-plugin": true
}
}
}This is the setting for a consuming project. A skill repo that ships its own PHP code sets it to false for itself — see Skill repos that ship their own PHP code.
"SKILL.md not found"
- Verify path in
extra.ai-agent-skill - Paths must be relative from package root
- Absolute paths are rejected for security