Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

composer-security-update

БесплатноЗапускает вложенные скриптыНе проверен

This skill should be used when the user asks to "run a Composer security update", "validate the security PR", "check the automated security PR", "run composer…

kanopiот kanopi★ 18 звёзд на GitHub

Об этом скилле

Composer Security Update

Purpose

Validate the automated security pull request for a Teamwork task, and finish it when the automation fell short.

The Kanopi security dashboard now does the opening moves on its own. For each site with published advisories it creates a Teamwork task titled Security Advisory: {Site} - {packages}, runs a targeted composer update in CI, opens a pull request from a security/tw-{task} branch, and comments the PR link on the task. This skill does not repeat any of that. Do not create a task, cut a new branch, or open a new PR.

What the automation cannot do is the part that needs a running site: prove each advisory actually cleared, run update hooks against production-like data, check config drift, rebuild themes, and judge whether the lock diff is scoped tightly enough to ship. That is this skill's job.

The discipline is still scope and honesty. The bot's update is targeted but not always minimal: it can land a newer minor than the advisory needs, or move transitive packages. And it runs without --with-all-dependencies, so an advisory pinned by a root requirement can stay installed while the PR still looks like a fix. Both get reported, not glossed over.

Scope and safety

  • Work on the automated PR's own head branch. Never cut a new branch, never open a second PR, and never create or rename the Teamwork task.
  • The deliverable is the validated PR: any fix-up commits pushed to its branch, and a validation section added to its description. Push only after the user has read the drafted text and said to go, even when their instructions otherwise forbid pushing. Never push on your own judgement that it looks fine. Never force-push, never rewrite or squash the bot's commit, never push to the base branch, never merge, never approve the PR.
  • Do not change the PR title. The dashboard sets it.
  • If no open automated PR exists for the task, stop and ask, starting with the line NO AUTOMATED SECURITY PR: this skill validates an existing PR and does not create one. Do not fall back to creating a branch, running the update yourself, or opening a PR, even when the user asks for that as a shortcut.
  • Snapshot the DDEV database before the first branch switch and restore it at the end. The refresh in step 6 and drush updatedb in step 9 both replace or mutate the local database; the snapshot is what makes this reversible.
  • Report Drupal config drift. Do not run config:export to "fix" it and do not commit exported config unless the user asks.
  • Do not widen a composer.json constraint to reach a fixed version unless the user asks. Widening can pull a major version, a different risk profile than a security patch.
  • Stop and report if the working tree is dirty at the start. Do not stash the user's work.
  • Follow the commit conventions in the user's and the project's CLAUDE.md, including any rule about AI attribution trailers.

Workflow

1. Preflight

git status --short
git rev-parse --abbrev-ref HEAD
ddev describe

Record the starting branch; it is restored in step 14. If the tree is dirty, stop and tell the user, starting with the line WORKING TREE NOT CLEAN: commit or stash before continuing. Do not switch branches, snapshot, or run Composer until they have. Stop as well if DDEV is not running.

2. Find the task and its automated PR

The user may give a Teamwork task ID, a task URL like https://kanopi.teamwork.com/app/tasks/30160608 whose trailing number is the ID, a PR number or URL, or nothing. With nothing, ask and stop.

Fetch the task with the Teamwork MCP (twprojects-get_task). Its description is the dashboard's advisory list: for each package, the CVE, the SA identifier, severity, and the version that fixes it. Record that list; it is what the ticket asked for, and step 8 checks the PR against it. Without the Teamwork MCP, ask the user to paste the task description rather than guessing the advisories.

Find the PR, in this order:

  1. The task's comments (twprojects-list_comments with task_id). The dashboard posts one starting "An automated pull request is ready for review" with a GitHub PR link.

  2. GitHub, by branch name:

    gh pr list --state all --search "head:security/tw-<task-id>" --json number,url,state,headRefName,baseRefName,author
    

Confirm before going further:

gh pr view <number> --json number,url,state,isDraft,author,headRefName,baseRefName,title,body,files,commits
  • state is OPEN. A merged PR needs no validation branch; a closed one means someone rejected it. Report either and stop.
  • The head branch is security/tw-<task-id> and the task ID matches.
  • Keep the original body exactly as returned; step 12 appends to it.

If the user gave a PR instead of a task, read the task ID from the branch name or the body's Teamwork task: line and fetch the task anyway.

The base branch is the PR's baseRefName, not an assumption about main. Some projects

Полный SKILL.md на GitHub

Установить composer-security-update в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlscripts/audit_table.py

FAQ

Что делает скилл composer-security-update?

This skill should be used when the user asks to "run a Composer security update", "validate the security PR", "check the automated security PR", "run composer audit", "patch the security advisories", "update the vulnerable packages", "fix the CVEs in this project", "apply the Drupal core security release", or hands over a "Security Advisory:" Teamwork task or a `security/tw-*` pull request. Use it whenever a Drupal or WordPress Composer project needs its advisories resolved, even if the user only says "are we vulnerable?" or names a single CVE. It finds the PR the Kanopi security dashboard already opened, validates its branch locally (composer audit before and after, DDEV snapshot and refresh, update hooks, config drift, theme builds), and reports each advisory as cleared or blocked. Fix-ups and the PR update wait for user approval. It never creates a task, branch, or PR. Dependabot bumps belong to dependabot-branch-validation; patching contrib code belongs to composer-patch-generator.

Как установить скилл composer-security-update?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл composer-security-update запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить composer-security-update с