Skip to content

Fix AI instruction standard to enforce JSON-first styling (LS-2338) - #21

Merged
brandonmarshal merged 5 commits into
developfrom
feature/ls-2338-phase-0-fix-the-ai-instruction-standard-agentsmd-skills
Aug 7, 2026
Merged

Fix AI instruction standard to enforce JSON-first styling (LS-2338)#21
brandonmarshal merged 5 commits into
developfrom
feature/ls-2338-phase-0-fix-the-ai-instruction-standard-agentsmd-skills

Conversation

@brandonmarshal

@brandonmarshal brandonmarshal commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added an explicit JSON-first / CSS-last-resort rule to AGENTS.md's Theme-First Approach, matching the standard used by the kwv-theme-2026 reference theme
  • Added a mandatory JSON-vs-CSS gate to .agents/agents/wordpress-theme-styling-auditor.agent.md and .agents/skills/pattern-extractor/SKILL.md so Sass/GSAP/is-styles are only used when theme.json genuinely cannot express the style
  • Fixed an incorrect claim in AGENTS.md and .github/instructions/theme-json.instructions.md stating styles/blocks/ and styles/sections/ aren't auto-consumed by WordPress (they are, WP 6.6+)
  • Referenced the new wp-block-style-audit skill from AGENTS.md as the authoritative JSON-vs-CSS decision procedure
  • Docs/config only — no theme front-end code changed

Test plan

  • AGENTS.md states an explicit JSON-first / CSS-last-resort rule
  • No dangling instruction-file references in edited files
  • Zero changes to theme output/front-end code

Summary by CodeRabbit

  • New Features

    • Added auditing support for WordPress block style JSON, including tokens, pseudo-states, scoped block styles, and CSS-only exceptions.
    • Style files can now be automatically discovered as user-visible style options in the WordPress editor.
  • Documentation

    • Clarified that theme.json and style JSON are the primary styling systems.
    • Added guidance for using Sass, CSS, and animation tools appropriately.
    • Documented style variation structure and validation requirements for WordPress 6.6+.
  • Compatibility

    • Updated the minimum required WordPress version to 6.9.

Add explicit JSON-first/CSS-last-resort rule to AGENTS.md, matching
kwv-theme-2026's standard, plus a JSON-vs-CSS gate to the styling
auditor agent and pattern-extractor skill so Sass/GSAP/is-styles are
only used when theme.json genuinely cannot express the style. Fixes
the incorrect claim that styles/blocks/ and styles/sections/ aren't
auto-consumed by WordPress (AGENTS.md and theme-json.instructions.md).
Integrates Zared's new wp-block-style-audit skill as the authoritative
decision procedure. Docs/config only — no theme output changes.
@brandonmarshal brandonmarshal added ai-ops:instructions AI instruction docs lang:md Markdown content/docs priority:important High impact; schedule next. status:needs-review Awaiting code review labels Aug 7, 2026
@brandonmarshal brandonmarshal self-assigned this Aug 7, 2026
@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown

LS-2338

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brandonmarshal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: d891a992-1576-43bf-8feb-ce1f70a7afe8

📥 Commits

Reviewing files that changed from the base of the PR and between bfc0678 and 2c940d0.

📒 Files selected for processing (3)
  • .agents/skills/wp-block-style-audit/SKILL.md
  • README.md
  • style.css

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "version"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The PR adds a block-style audit skill and JSON-first styling rules across agent instructions, theme guidance, and pattern extraction. It documents recursive style discovery in WordPress 6.6+ and raises the theme requirement to WordPress 6.9.

Changes

JSON-first styling governance

Layer / File(s) Summary
Block style audit foundation
.agents/skills/wp-block-style-audit/SKILL.md, .agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md
Adds procedures for auditing block style JSON, classifying CSS, validating tokens, assigning ownership, and verifying supported and unsupported cases.
Theme policy and auditing
AGENTS.md, .github/instructions/theme-json.instructions.md, .agents/agents/wordpress-theme-styling-auditor.agent.md
Makes style JSON authoritative, documents recursively discovered style-picker options, and requires CSS rules to be checked for JSON equivalents.
Pattern extraction JSON-first gate
.agents/skills/pattern-extractor/SKILL.md
Requires JSON styles before authored CSS and limits GSAP to interactions that CSS cannot implement.
WordPress version requirement
style.css
Raises the minimum supported WordPress version from 6.4 to 6.9. The existing code/pre rule remains unchanged.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: area:theme, comp:theme-json, lang:css

Suggested reviewers: zaredrogers

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enforcing a JSON-first styling standard in AI instructions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ls-2338-phase-0-fix-the-ai-instruction-standard-agentsmd-skills

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md:
- Line 9: Update the "$schema" example in the block-style JSON anatomy
documentation to use the WordPress 6.6 schema URL as the compatibility lock,
replacing the WordPress 6.9 URL. Keep the documented theme.json v3 support
aligned with this schema reference.

In @.agents/skills/wp-block-style-audit/SKILL.md:
- Around line 74-79: Update the token-reference guidance in SKILL.md section
“Check token references use the correct format” to document custom-token syntax:
var:custom|path|to|key for JSON values and var(--wp--custom--path--to--key) for
CSS strings. Extend validation instructions to verify custom tokens against
theme.json settings.custom in addition to preset tokens against
settings.presets.
- Line 4: Keep the WordPress 6.9+/theme.json v3 requirement explicit in the
compatibility metadata of .agents/skills/wp-block-style-audit/SKILL.md:4 because
this rule covers per-block :hover/:focus JSON support. Ensure the schema URL and
compatibility guidance in
.agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md:7-10
use the same 6.9 baseline; no 6.6 alignment is needed.

In `@AGENTS.md`:
- Around line 85-87: Scope the CSS exception-comment requirement to new or
modified rules so existing valid exceptions remain compliant without retroactive
comments. Update AGENTS.md lines 85-87 and
.agents/agents/wordpress-theme-styling-auditor.agent.md lines 56-61 to use the
same scoped policy and ensure the audit condition matches it.
- Around line 88-91: Update the structural-properties rule in AGENTS.md to be
conditional: require JSON or block attributes when the property has a supported
key, but permit unsupported properties such as overflow, max-width, and width in
Sass/CSS when the limitation is documented. Keep the existing guidance that
filename or folder does not exempt properties from the rule.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fee7f01-9b27-485e-8c71-412251129a26

📥 Commits

Reviewing files that changed from the base of the PR and between be67839 and a2f2b5f.

📒 Files selected for processing (6)
  • .agents/agents/wordpress-theme-styling-auditor.agent.md
  • .agents/skills/pattern-extractor/SKILL.md
  • .agents/skills/wp-block-style-audit/SKILL.md
  • .agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md
  • .github/instructions/theme-json.instructions.md
  • AGENTS.md

Comment thread .agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md Outdated
Comment thread .agents/skills/wp-block-style-audit/SKILL.md
Comment thread .agents/skills/wp-block-style-audit/SKILL.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the repo’s AI and theme documentation to enforce a stricter JSON-first (theme.json/style JSON) styling standard, and documents WordPress 6.6+ auto-discovery of block/section style JSON files, with a small metadata bump in the theme header.

Changes:

  • Tightened the “Theme-First Approach” guidance to make JSON the default styling layer and Sass/CSS/GSAP explicit exceptions.
  • Corrected documentation to reflect that styles/blocks/ and styles/sections/ are auto-discovered as editor-facing style options in WP 6.6+.
  • Added a new wp-block-style-audit skill and wired it into existing agent/skill guidance to standardise JSON-vs-CSS decisions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
style.css Bumps the theme’s minimum required WordPress version to 6.9.
AGENTS.md Adds explicit JSON-first / CSS-last-resort rules and updates style variation discovery guidance.
.github/instructions/theme-json.instructions.md Aligns theme.json instructions with WP 6.6+ style JSON auto-discovery behaviour.
.agents/skills/wp-block-style-audit/SKILL.md Introduces a new audit procedure for migrating CSS-heavy block style JSON into structured JSON.
.agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md Adds a reference doc describing block style JSON structure, supported keys, and decision rules.
.agents/skills/pattern-extractor/SKILL.md Adds a mandatory JSON-first gate before allowing Sass/CSS/GSAP/is-style work.
.agents/agents/wordpress-theme-styling-auditor.agent.md Updates the agent’s operating rules/workflow to treat Sass/CSS as an exception layer and reference the audit skill.

Comment thread AGENTS.md Outdated
Comment thread .agents/skills/wp-block-style-audit/SKILL.md Outdated
… (LS-2338)

Fix schema URL to match the theme's actual trunk convention, document
missing var:custom token syntax, align UK spelling, and scope the
JSON-limitation-comment and structural-properties rules to new/modified
CSS only so they don't retroactively invalidate existing valid
exceptions (e.g. transitions/overflow/max-width that JSON has no key
for). Applies to AGENTS.md, the styling auditor agent, and the new
wp-block-style-audit skill.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/wp-block-style-audit/SKILL.md:
- Around line 81-82: Update the token validation guidance to resolve preset
references by category under the corresponding theme.json settings collection,
such as settings.color.palette, settings.typography.fontSizes, or
settings.spacing.spacingSizes, rather than a generic settings.presets
collection. Continue validating custom token paths against settings.custom.
- Around line 13-15: Update the guidance in the style-audit bullets to
distinguish block-root color and background rules from descendant element
styles: map root `.wp-block-*` styles to `blocks["block/name"].color`, while
mapping selectors such as `.wp-block-button__link` or `a` to the appropriate
`elements` configuration. Keep descendant nested-block and third-party block
guidance separate.

In `@style.css`:
- Line 8: Synchronize the documented WordPress minimum by updating the WordPress
version requirement in the README’s requirements section to match the 6.9
minimum declared by the style.css “Requires at least” metadata, or consistently
lower both declarations if 6.9 is not intended.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c38a201-386d-4f79-a615-d9cc84e19c89

📥 Commits

Reviewing files that changed from the base of the PR and between a2f2b5f and bfc0678.

📒 Files selected for processing (5)
  • .agents/agents/wordpress-theme-styling-auditor.agent.md
  • .agents/skills/wp-block-style-audit/SKILL.md
  • .agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md
  • AGENTS.md
  • style.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • .agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md
  • .agents/agents/wordpress-theme-styling-auditor.agent.md

Comment thread .agents/skills/wp-block-style-audit/SKILL.md Outdated
Comment thread .agents/skills/wp-block-style-audit/SKILL.md Outdated
Comment thread style.css Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (4)

.agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md:59

  • This sentence says both link and button support :visited, but elsewhere in the same doc :visited is only listed under elements.link. Buttons don’t have a visited state, so this is misleading.
`link` and `button` elements support `:hover`, `:focus`, `:active`, `:visited` as sibling keys:

.agents/skills/wp-block-style-audit/SKILL.md:82

  • theme.json doesn’t have a settings.presets key. Presets live under specific sections (e.g. settings.color.palette, settings.typography.fontFamilies, etc.), so this instruction is currently pointing readers at a non-existent path.
Verify every preset token slug exists in `theme.json` `settings.presets` and
every custom token path exists in `theme.json` `settings.custom` before using it.

.agents/skills/wp-block-style-audit/references/block-style-json-anatomy.md:10

  • The minimal JSON example uses the trunk theme.json schema URL, but this repo’s style JSON files (and this skill’s compatibility note) are targeting the WP 6.9 schema. Using the versioned schema here would keep the guidance consistent with the rest of the theme.

This issue also appears on line 59 of the same file.

  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "version": 3,

style.css:9

  • Theme header metadata now requires WP 6.9 / tested up to 7.0, but readme.txt still says "Requires at least: 6.4" and "Tested up to: 6.7". These should be kept consistent so tooling and users don’t get conflicting compatibility signals.
Requires at least: 6.9
Tested up to:      7.0

…on (LS-2338)

Distinguish blocks["block/name"].color (block-root) from elements.*
(descendant selectors like .wp-block-button__link) in the audit skill's
guidance table — these were previously conflated. Correct the token
validation reference from the non-existent settings.presets to the
real per-category theme.json collections (settings.color.palette,
settings.typography.fontSizes, settings.spacing.spacingSizes). Sync
README.md's documented WordPress minimum (6.4+ -> 6.9+) with style.css.

@ZaredRogers ZaredRogers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good @brandonmarshal

@brandonmarshal
brandonmarshal merged commit 678b711 into develop Aug 7, 2026
5 of 7 checks passed
@brandonmarshal
brandonmarshal deleted the feature/ls-2338-phase-0-fix-the-ai-instruction-standard-agentsmd-skills branch August 7, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-ops:instructions AI instruction docs lang:md Markdown content/docs priority:important High impact; schedule next. status:needs-review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants