Skip to content

WP Origin: export Guidelines skills for coding agents#34

Open
artpi wants to merge 1 commit intotrunkfrom
guidelines
Open

WP Origin: export Guidelines skills for coding agents#34
artpi wants to merge 1 commit intotrunkfrom
guidelines

Conversation

@artpi
Copy link
Copy Markdown
Contributor

@artpi artpi commented Apr 29, 2026

Summary

  • Gate WP Origin Guidelines support on the wp_guideline CPT and wp_guideline_type taxonomy being available.
  • Install a default coding-agent skill titled WP Origin AGENTS.md with slug/source wp-origin when Guidelines are enabled.
  • Export Guidelines content under wp_guideline/<type>/...; skills export as wp_guideline/skills/<slug>/SKILL.md with Codex-compatible frontmatter generated from WordPress fields.
  • Expose agent discovery paths with .agents/skills, .claude/skills, AGENTS.md, and CLAUDE.md symlinks only when the Guidelines skill exists.
  • Add Git repository support and tests for symbolic-link entries used by the exported agent paths.

Validation

  • vendor/bin/phpcs -d memory_limit=1G plugins/wp-origin/class-wp-origin-plugin.php plugins/wp-origin/functions.php plugins/wp-origin/wp-origin.php plugins/wp-origin/class-wp-origin-seeder.php bin/test-wp-origin-git-actions.sh
  • vendor/bin/phpunit components/Git/Tests/GitRepositoryTest.php
  • bin/test-wp-origin-git-actions.sh

@artpi artpi force-pushed the guidelines branch 5 times, most recently from 46d12ca to abdd713 Compare April 29, 2026 11:31
@artpi artpi marked this pull request as ready for review April 29, 2026 12:39
@artpi artpi self-assigned this Apr 29, 2026
@artpi artpi changed the title [codex] Add WP Origin guideline skill export WP Origin: export Guidelines skills for coding agents Apr 29, 2026
Comment on lines +61 to +65
if ( $fs->is_file( $target_path ) ) {
$fs->rm( 'objects/.tmp' );

return;
}
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.

Wouldn't this destroy the object we just wrote? Or is it just saving us some HDD operations on replacing the identical file, since $target_path is addressed via a content hash?

public function commit( $options = array() ) {
// First process all blob updates.
$updates = $options['updates'] ?? array();
$symlinks = $options['symlinks'] ?? array();
Copy link
Copy Markdown
Contributor

@adamziel adamziel Apr 29, 2026

Choose a reason for hiding this comment

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

nitpick: let's call it $options['create_symlinks'] to make the intent clear. I got a bit confused initially and had to read the rest of the diff to figure that out.

isset( $tree_objects[ $child_name ] ) &&
TreeEntry::FILE_MODE_DIRECTORY !== $tree_objects[ $child_name ]->get_mode_bucket()
) {
continue;
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 seems to be silently ignoring references to descendants of symlinks. Why? Let's document it inline. Should we throw an error instead?

Also, I'd rather check for symlinks explicitly:

TreeEntry::FILE_MODE_SYMBOLIC_LINK === $tree_objects[ $child_name ]->get_mode_bucket()

The current condition could silently swallow errors such as "it's actually a file".

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