Skip to content

Add AGENTS.md agent docs with PHP coding standards - #384

Merged
MlKilderkin merged 5 commits into
task/base-agent-instructionsfrom
feature/php-coding-standards
Aug 26, 2026
Merged

Add AGENTS.md agent docs with PHP coding standards#384
MlKilderkin merged 5 commits into
task/base-agent-instructionsfrom
feature/php-coding-standards

Conversation

@MlKilderkin

Copy link
Copy Markdown
Contributor

What does this do/fix?

Ships the AGENTS.md + docs/ai/ agent-instructions system, with ModernPress PHP coding standards in docs/ai/php.md (no separate coding-standards skill).

QA

Pull request checklist

  • I've added a changelog entry for these changes. (N/A unless you want a changelog for agent docs)
  • I've linked to a relevant Jira issue.
  • I've captured a screenshot or screencast of the changes and linked it above. (N/A)

@LayaTaal LayaTaal 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.

@MlKilderkin thank you for putting this together, I think it looks good. I am torn with all of the instruction in the php.md file. On the one hand I really like the very clear directions. On the other I am worried we might get force AI into situations where it doesn't know what to do. But I'm fine testing this as is for a while to see how it goes.

Comment thread docs/ai/php.md Outdated
Comment on lines +184 to +195
### Blocks (PHP)

- Do not put block logic in `render.php`. Keep templates thin.
- Trivial attribute reads (≈1–6 lines) can stay in the template. Anything that transforms
attributes, branches, loops meaningfully, or computes values belongs in a controller.
- Dynamic block controllers extend
`Tribe\Plugin\Components\Abstracts\Abstract_Block_Controller`; follow existing
controllers in `wp-content/plugins/core/src/Components/Blocks`.
- Theme block PHP usually extends `Tribe\Plugin\Blocks\Block_Base` (core-block extensions)
or uses plugin controllers for dynamic `tribe/*` render templates.
- Use `get_block_wrapper_attributes()` for wrappers. Use PHPCS escape-output ignores only
for intentionally safe pre-escaped markup (wrapper attrs, rendered inner blocks).

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.

This feels redundant. I think just a pointer in one of the two files will be enough to keep AI on track (ha!)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

Comment thread docs/ai/prs.md Outdated
@@ -0,0 +1,29 @@
# Pull Requests & Commit Messages – Agent Reference

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.

I'm not sure we need this here. We should be using the git-workflow skill in tribe-skills to handle this across projects beyond ModernPress.

I would probably prefer we make updates to that skill if we need more definition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

@MlKilderkin

Copy link
Copy Markdown
Contributor Author

@LayaTaal I added some small changes to make it more flexible

On the other I am worried we might get force AI into situations where it doesn't know what to do. But I'm fine testing this as is for a while to see how it goes.

I understand the concern, but I think these constraints are useful. With lighter guidance, I have seen AI produce code that technically works but does not follow the architecture we want to maintain. That can turn a small feature into 30–60 minutes of review spent explaining architectural concerns instead of reviewing the feature itself.

Most of the rules in php.md are not arbitrary limitations. They document project decisions we already want to enforce. Without them, AI has to infer patterns from the codebase, and legacy or incorrect code can easily become precedent.

The goal is not to remove judgment, but to narrow the solution space to approaches that fit our architecture. I would rather start with clear rules and relax specific ones if they prove too restrictive in practice.

@LayaTaal

Copy link
Copy Markdown
Contributor

@LayaTaal I added some small changes to make it more flexible

On the other I am worried we might get force AI into situations where it doesn't know what to do. But I'm fine testing this as is for a while to see how it goes.

I understand the concern, but I think these constraints are useful. With lighter guidance, I have seen AI produce code that technically works but does not follow the architecture we want to maintain. That can turn a small feature into 30–60 minutes of review spent explaining architectural concerns instead of reviewing the feature itself.

Most of the rules in php.md are not arbitrary limitations. They document project decisions we already want to enforce. Without them, AI has to infer patterns from the codebase, and legacy or incorrect code can easily become precedent.

The goal is not to remove judgment, but to narrow the solution space to approaches that fit our architecture. I would rather start with clear rules and relax specific ones if they prove too restrictive in practice.

That works for me @MlKilderkin and I agree with you - we have seen together how it can not follow our architecture easily and waste our time.

@LayaTaal

Copy link
Copy Markdown
Contributor

@MlKilderkin once this is merged, let me know and I'll announce the base PR so the rest of the team can review.

@MlKilderkin
MlKilderkin merged commit 2331797 into task/base-agent-instructions Aug 26, 2026
7 checks passed
@MlKilderkin
MlKilderkin deleted the feature/php-coding-standards branch August 26, 2026 14:03
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.

2 participants