Skip to content

Conversation

@slaFFik
Copy link
Member

@slaFFik slaFFik commented Nov 6, 2025

Description

Fixes #78.

I used this prompt to generate it.

go through reach rule in sniff files and create an AI-readable RULES.md file that I can then reference in all my other projects. I want ai
to read the file and understand how exactly WPForms PHPCS rules differ (modify, extend, or add new rules) from default WordPress PHPCS rules. The
idea is that in every new project I can reference this file, and AI, when writing code, will be able to understand that (for example) there should
 be a new line between `case` statements, or a new line before `return` statement, or a new line after the function declaration inside the
function body, and so on. Ask clarification questions if something is unclear.

---

User answered Claude's questions:
  ⎿ Should RULES.md focus on actionable coding guidelines ("do this, not that") or also include technical implementation details about how sniffs work? → 
    ⎿  Actionable guidelines only

  ⎿ Should the document include examples of correct/incorrect code for each rule?
    ⎿ Yes, show code examples
    
  ⎿ How should rules be organized in the document?
    ⎿ By category (Comments, Formatting, PHP, etc.)

  ⎿ Should the document explain which WordPress PHPCS rules are disabled/modified, or only focus on new/additional rules?
    ⎿ Include disabled WPCS rules, Include modified WPCS rules

After that, I asked claude to review and expand on the rules and the .md file. You can see the results in the 2nd commit.

I haven't included CLAUDE.md file as I think it doesn't matter for this usecase.

If merging, the branch should be squashed-n-merged (so a single commit lands into the main branch).

@slaFFik slaFFik marked this pull request as ready for review November 6, 2025 21:16
@kagg-design kagg-design self-assigned this Nov 11, 2025
@kagg-design kagg-design self-requested a review November 11, 2025 12:02
Copy link
Contributor

@kagg-design kagg-design left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @slaFFik, great addition!

I will use it in our projects.

@kagg-design kagg-design merged commit 6bbbc16 into main Nov 11, 2025
1 check passed
@kagg-design kagg-design deleted the 78-rules-description branch November 11, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate RULES.md which is a extensive list of all rules in human/ai readable format

3 participants