-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yml
More file actions
153 lines (137 loc) · 5.25 KB
/
Copy path.coderabbit.yml
File metadata and controls
153 lines (137 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
language: en-US
reviews:
enabled: true
profile: assertive
auto_review:
enabled: true
drafts: false
auto_incremental_review: true
base_branches:
- main
- develop
- feature/.*
- fix/.*
request_changes_workflow: true
high_level_summary: true
collapse_walkthrough: true
assess_linked_issues: true
related_issues: true
related_prs: true
path_filters:
- "!node_modules/**"
- "!vendor/**"
- "!assets/css/*.map"
finishing_touches:
autofix:
enabled: true
docstrings:
enabled: true
unit_tests:
enabled: true
tools:
eslint:
enabled: true
markdownlint:
enabled: true
gitleaks:
enabled: true
trufflehog:
enabled: true
path_instructions:
- path: "theme.json"
instructions: |
Review for WordPress block theme compatibility.
Validate the $schema reference.
Check that the version field is correct (currently 3 for WP 6.6+).
Ensure colour palette slugs are consistent with style variations.
Ensure font family slugs are consistent with enqueued fonts.
Flag any deprecated settings.
Check that placeholder tokens ({{...}}) have been replaced if this is not a starter template.
- path: "styles/*.json"
instructions: |
Review as WordPress block theme style variations.
Check that colour references use var(--wp--preset--color--...) slugs that exist in theme.json.
Check that font references use slugs that exist in theme.json.
Ensure these are valid JSON.
Flag any placeholder tokens that have not been replaced.
- path: "styles/blocks/**/*.json"
instructions: |
Review as per-block style JSON. Confirm valid JSON structure.
Note that these are not automatically consumed by WordPress as style variations
unless registered explicitly.
- path: "styles/sections/**/*.json"
instructions: |
Review as per-section style JSON. Confirm valid JSON structure.
Note that these are an internal organisational convention.
- path: "patterns/*.php"
instructions: |
This is a WordPress block pattern file.
Review for correct Pattern registration header comments.
Critically review for PHP escaping: all output must use esc_html(), esc_attr(), esc_url(), or wp_kses_post() as appropriate.
Review for correct translation function usage.
Flag any unescaped echo or print statements.
Flag any direct use of $_GET, $_POST, $_REQUEST.
- path: "functions.php"
instructions: |
Keep this file minimal — it is a block theme functions file, not a plugin.
Review for correct action and filter hook usage.
Review for correct escaping, sanitisation, and validation.
Flag any unnecessary complexity.
Flag any feature that should live in a plugin instead.
- path: "inc/**/*.php"
instructions: |
Review for correct escaping, sanitisation, and validation.
Flag unescaped output, direct database queries without $wpdb->prepare(), and security risks.
Check for correct translation function usage.
- path: "templates/*.html"
instructions: |
Review as a WordPress block template (HTML with block markup comments).
Check for semantic HTML.
Check that referenced template parts exist in parts/.
Check heading hierarchy and accessibility.
Flag any non-block HTML that might not render correctly in FSE.
- path: "parts/*.html"
instructions: |
Review as a WordPress block template part.
Check for semantic HTML and accessibility.
Check heading hierarchy.
Ensure skip-link and landmark roles are present in header parts.
- path: "assets/js/*.js"
instructions: |
Review for correct JS practices.
Avoid global scope pollution.
Flag insecure patterns such as innerHTML with unescaped data.
Keep it lean — this is a block theme, not a JS application.
- path: "assets/css/*.css"
instructions: |
Review for correctness.
Prefer CSS custom properties over hardcoded values.
Use wp--preset variables where appropriate.
Keep specificity low.
- path: "AGENTS.md"
instructions: |
Review for accuracy. This is the primary guidance file for AI agents.
Ensure commands listed are consistent with package.json and composer.json.
Ensure placeholder strategy is documented.
- path: "README.md"
instructions: |
Review for accuracy and completeness.
Ensure commands listed are consistent with package.json and composer.json.
review_checklist:
- Check for WordPress block theme compatibility
- Check for accessibility issues (semantic HTML, heading hierarchy, ARIA)
- Check for PHP escaping and sanitisation
- Check for WordPress coding standards
- Check for consistent use of theme.json over PHP
- Check for unnecessary complexity or dependencies
- Check that placeholder tokens have been replaced (if not a starter)
- Check for consistent text domain usage
knowledge_base:
code_guidelines:
enabled: true
filePatterns:
- "AGENTS.md"
learnings:
scope: auto
chat:
enabled: true