Add agent skill and drush generator for Guardrail plugins
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3582575. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !1404
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>Add agent skill and drush generator for Guardrail plugins<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Guardrail plugins (<code>@AiGuardrail</code>) allow developers to add safety and validation checks on AI inputs and outputs. The plugin system includes multiple result types (<code>PassResult</code>, <code>StopResult</code>, <code>RewriteInputResult</code>, <code>RewriteOutputResult</code>), streaming considerations (<code>NonStreamableGuardrailInterface</code>), and score aggregation. Creating a guardrail requires understanding all of these concepts.</p>
<p>An agent skill and Drush generator would help developers quickly create custom guardrails for their specific safety requirements.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Create <code>.agent/skills/create-guardrail/SKILL.md</code> describing how to create a Guardrail plugin, including the <code>@AiGuardrail</code> attribute, the <code>AiGuardrailPluginBase</code> base class, and the <code>processInput()</code>/<code>processOutput()</code> methods.</li>
<li>Document the four result types and when to use each one.</li>
<li>Document <code>NonStreamableGuardrailInterface</code> and <code>NonDeterministicGuardrailInterface</code>.</li>
<li>Include a complete working example of a guardrail plugin.</li>
<li>Add a Drush generate command (<code>drush generate ai-guardrail</code>) that scaffolds the plugin class.</li>
</ul>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[x] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br>
[ ] AI Generated Code<br>
[ ] Vibe Coded</p>
<p>- <strong>This issue was created with the help of AI</strong></p>
issue