gkastanis/drupal-workflow46 installs
drupal-conventions
Load Drupal-specific conventions (translations, CSS, error handling) on demand. Use when working on theming, translations, or exception handling.
How do I install this agent skill?
npx skills add https://github.com/gkastanis/drupal-workflow --skill drupal-conventionsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides Drupal-specific coding guidelines for translations, CSS, and error handling. No malicious patterns or security risks were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Drupal Conventions (JIT)
Load these conventions only when relevant to the current task.
Translation Rules
- Wrap all user-facing text in
t()orTranslatableMarkup. - Use module name as context (PHP string, not constant).
- English in code, translations in
/translations/*.pofiles withmsgctxt. - Twig:
|tfilter for strings,{% trans %}blocks for placeholders. - PO format:
msgctxt "my_module"/msgid "English"/msgstr "Translated".
CSS Conventions
- Target specific elements (
.parent .child), not parent containers. - BEM:
block__element--modifierstrictly for custom classes. - Use
{{ attach_library('my_theme/component') }}for all assets. - Every asset bundle needs a matching
*.libraries.ymlentry. - Mobile-first responsive design. Use Drupal breakpoints for responsive images.
Error Handling
- Always use exceptions for errors, not
NULL/FALSEreturns. - Never catch
\Exception— catch the narrowest exception you can handle. - Avoid catching just to log (unless error doesn't affect caller).
- Always return early with clear error messages (fail fast).
// Good: specific exception, early return.
if (!$entity) {
throw new EntityNotFoundException("Entity $id not found.");
}
// Bad: silently swallowing errors.
try {
$result = $service->process();
} catch (\Exception $e) {
// Never do this.
}
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/gkastanis/drupal-workflow/drupal-conventions">View drupal-conventions on skillZs</a>