Add Agent Skills validation
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3581859. --> Reported by: [ronaldtebrake](https://www.drupal.org/user/2314038) Related to !3 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The <a href="https://agentskills.io/specification" title="specification for Agent Skills">specification for Agent Skills</a> comes with a format and requirements I think we want to meet/validate for every Skill we're adding here. </p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>There is a <a href="https://github.com/agentskills/agentskills/blob/main/skills-ref/src/skills_ref/validator.py">validation tool</a> I've created a PHP version of, see: <a href="https://github.com/ronaldtebrake/agent-skills-validator" title="Validator repo">ronaldtebrake/agent-skills-validator</a>.</p> <p>I've used this in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai_skills/issues/3566787" title="Status: Closed (fixed)">#3566787: Run Gitlab CI validation when skills are added</a></span> as part of the Gitlab CI to validate any skills added there. </p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>- Decide on the information architecture at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai_best_practices/-/work_items/3581836" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai_best_practices/-/work_items/3581836</a></span> and requirements there (that could mean we need more validation?)<br> - Add dev dependency to the repo or fork the code in here, both would work for me<br> - add <a href="https://git.drupalcode.org/project/ai_skills/-/blob/1.0.x/.gitlab-ci.yml?ref_type=heads">Gitlab CI template</a> validating the right directory </p> <div class="codeblock"> <pre><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br>&nbsp; rules</span><span style="color: #007700">:<br>&nbsp;&nbsp;&nbsp; - if: </span><span style="color: #0000BB">$CI_PIPELINE_SOURCE </span><span style="color: #007700">== </span><span style="color: #DD0000">"merge_request_event"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">changes</span><span style="color: #007700">:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">paths</span><span style="color: #007700">:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - [</span><span style="color: #0000BB">DIRECTORY</span><span style="color: #007700">]</span><span style="color: #FF8000">/**/</span><span style="color: #007700">*<br>&nbsp; </span><span style="color: #0000BB">script</span><span style="color: #007700">:<br>&nbsp;&nbsp;&nbsp; - </span><span style="color: #0000BB">vendor</span><span style="color: #007700">/</span><span style="color: #0000BB">bin</span><span style="color: #007700">/</span><span style="color: #0000BB">agent</span><span style="color: #007700">-</span><span style="color: #0000BB">skills</span><span style="color: #007700">-</span><span style="color: #0000BB">validator </span><span style="color: #007700">[</span><span style="color: #0000BB">DIRECTORY</span><span style="color: #007700">]<br></span><span style="color: #0000BB">?&gt;</span></span></pre></div> <p>Which could give output like:</p> <p><img src="https://www.drupal.org/files/issues/2026-01-14/Screenshot%202026-01-10%20at%2016.11.51.png" alt="valid skill"><br> <img src="https://www.drupal.org/files/issues/2026-01-14/Screenshot%202026-01-10%20at%2016.09.34.png" alt="invalid skill"></p> <p>On any merge request with a Skill added to the directory </p> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <p>[x] AI Generated Code<br> <br>This code was mainly generated by an Cursor with human guidance, and reviewed, tested, and refined by a human.</p> > Related issue: [Issue #3581836](https://www.drupal.org/node/3581836)
issue