Needs review
Project:
AI Best Practices for Drupal
Version:
1.0.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Mar 2026 at 16:40 UTC
Updated:
21 Apr 2026 at 18:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
webchickOk, dug into this a bit today.
With these things taken together, we should not try and replicate these coding standards in this repo. We should instead treat https://git.drupalcode.org/project/coding_standards as the canonical, up to the minute resource that agents should refer to, and we should inform agents of this fact.
Comment #3
webchickNext, what agent skills already exist that cover this ground? I found:
Additionally, Claude found:
Comment #4
webchickClaude's recommended architecture:
Key Takeaway for the Issue
The landscape splits into two camps that ai_best_practices should be aware of:
The
ai_best_practicesguidance file could usefully bridge both — pointing to the canonical docs and instructing agents to actually usedrupal/coder+phpcswhen they exist in the project.Recommended Structure
Part 1: Passive guidance in
AGENTS.md(always-loaded context)A short entry — two or three sentences max — that every agent sees in every session. It should:
This goes in AGENTS.md at the root, which is load-bearing and must stay short per the IA issue's guidance.
Part 2: A dedicated skill at skills/coding-standards/
This is what gets loaded on demand when an agent is actually writing or reviewing code. It should follow the progressive disclosure pattern that all the well-structured skills use:
What belongs in SKILL.md vs the references
SKILL.md should be under ~60 lines and cover:
The references stay lean. Rather than duplicating the standards themselves, each reference file should just capture the most-commonly-violated patterns per file type as quick-reference, with a direct link to the canonical page for full detail. This avoids the staleness problem entirely.
[Then it had this comparison table I'm not going to try and copy paste here but have attached as an image ;)]
The hybrid — detect tooling first, fall back to curated reference, always cite the canonical source — is what none of the existing projects do cleanly. That's the gap ai_best_practices can fill with authority,
Comment #6
webchickOk, first time trying GitLab merge requests and all that business, hopefully I did it right. :D
This is what Claude Code came up with when I pointed it to the issue and asked it to follow the plan made by itself 🤣
Comment #7
webchickAttempted to credit all of the people who own the repos listed above at https://new.drupal.org/contribution-record/11447435 — if I missed anyone let me know!
Comment #9
zorz commentedAdded evals while testing the compare.py workflow, let me know if you'd prefer these on a separate branch.
Comment #10
thejimbirch commentedThis may not be the place, but how about the inclusion of PHPstan and Rector?
Comment #11
yautja_cetanu commented@Jimbirch, yes I definitely agree with this.
Is there a reason it doesn't come by default with ddev? Don't you want to do phpstan and other linting tests etc almost every time you do anything with DDEV? For the AI stuff these kinds of deterministic review stuff I think is essential.
Comment #12
rakhimandhania commentedComment #13
webchickUnassigning myself; I still am interested in how this gets done but realistically there are far more capable people than me of doing it :D