scottfalconer/drupal-contribute-fix
Overview
This skill turns local Drupal contrib/core fixes into maintainer-friendly contributions by searching drupal.org, preventing duplicate work, and generating ready-to-submit patches and comments. It enforces a preflight gatekeeper search before creating any patch and produces a package of artifacts after a local fix so you can submit upstream with minimal friction.
How this skill works
Before editing contrib or core code, the skill runs a preflight search against drupal.org to detect existing issues, patches, or merge requests that match your error keywords and paths. If no upstream fix exists, it helps create a clean local fix and runs the package step to produce a properly named patch file, ISSUE_COMMENT.md, REPORT.md, and a directory with validation output. It refuses to generate patches until upstream checks complete and stops for security-sensitive findings.
When to use it
- When a contrib module name (metatag, webform, paragraphs, mcp, etc.) is mentioned with 'error', 'bug', 'issue', 'exception', or 'not working'.
- When an error/stack trace originates from web/docroot core or modules/contrib paths.
- Before editing files under docroot/web modules/contrib, core, or themes/contrib.
- When creating a Composer patch for a drupal/* package or adding entries to patches/.
- If custom code triggers a bug in contrib/core or hosting constraints (Acquia, Pantheon, Platform.sh) cause contrib failures.
Best practices
- Always run preflight before editing contrib/core code to avoid duplicating upstream fixes.
- Provide specific, reproducible test steps when packaging a fix; generic placeholders are unacceptable.
- Preserve the .drupal-contribute-fix directory, generated patches, ISSUE_COMMENT.md, and REPORT.md—never delete them.
- Keep patches minimal: separate must-fix changes from nice-to-haves and avoid broad, environment-specific hacks.
- Run php -l and PHPCS (if available) during packaging and report validation results honestly.
Example use cases
- User reports 'metatag module has an error' — run preflight, find existing patch or generate a new patch and ISSUE_COMMENT.md.
- A custom module triggers an exception from paragraphs — detect contrib origin, preflight, and produce a contribution artifact.
- Fix required only locally due to hosting constraints on Acquia — create patch with package and document how to submit upstream.
- You modified docroot/modules/contrib/mcp — run package to create a properly named .patch and a paste-ready comment for drupal.org.
FAQ
The skill stops and reports the candidate; follow the existing MR/patch guidance instead of creating a duplicate patch.
Can I delete the generated artifacts after applying a local fix?
No. Always preserve the .drupal-contribute-fix directory and its files so the fix can be submitted upstream later.