Conversation
Add the skills/slic/ directory following the Agent Skills specification (agentskills.io). SKILL.md is the entry point with frontmatter, workflow overview, and links to sub-documents. test-anatomy.md covers test file skeleton, naming, namespaces, and the AAA pattern. environment-setup.md describes three tiers of setUp/tearDown complexity.
Add tutorial-style guides for HTTP mocking (3 patterns), assertions with WordPress factories, advanced patterns (REST dispatch, Reflection, custom tables), and an 11-item test isolation checklist. Add reference docs for the complete slic CLI command set, setup and CI configuration, and the wp-browser WPLoader module with coverage of both v3 and v4 API differences.
Add a new "Agent Skills (AI-assisted testing)" section to the README with a table of contents entry. Describes what the skill provides, how AI agents discover it, and how to install it in other projects.
Include global (-g), per-project, per-agent (--agent), and list (--list) install commands matching the skills CLI options.
When `slic here` is run from a themes directory (without wp-config.php), slic previously entered "plugins directory mode" and set SLIC_PLUGINS_DIR to the themes directory. This caused plugins like WooCommerce to be cloned and installed inside wp-content/themes/, and Docker mounted the themes dir as wp-content/plugins/ in the container. This commit introduces proper theme-directory mode: - Add `slic_here_is_themes()`: returns true when SLIC_HERE_DIR matches SLIC_THEMES_DIR, indicating slic was pointed at a themes directory. - Update `get_valid_targets()`: include themes as valid `slic use` targets when in themes-directory mode (previously only included when slic_here_is_site()). - Fix `run.php`: replace `slic_plugins_dir(slic_target())` with `get_project_local_path()` so the host-side Codeception config lookup resolves to SLIC_THEMES_DIR/<theme> for theme targets instead of always falling back to SLIC_PLUGINS_DIR. - Fix `using.php`: same path resolution fix for the displayed target path. - Fix `build_command_pool()` and `maybe_build_install_command_pool()` in slic.php: use `get_project_local_path()` for composer/npm build file detection so these commands work correctly for theme targets. `get_project_local_path()` and `get_project_container_path()` in project.php already handled the 'theme' project type correctly — this change ensures the rest of the codebase uses them consistently. - Update README: document the themes directory as a first-class `slic here` option (option 2, before the WordPress root option), including the correct WPLoader suite config pattern for activating a theme under test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inline fixes: - Replace static::factory() with $this->factory() across all files - Change setUp/tearDown visibility from public to protected - Use PHP 7.4+ typed properties (int, array, \Closure) - Fix test method separator from : to :: in slic run examples - Add slic cc clean to command examples - Add Playwright version note and install command - Add table prefix collision warning in WPLoader config - Add visibility column to lifecycle methods table - Rework CI GitHub Actions example with PHP matrix and without slic init (projects should commit slic config files) New content: - composer.json PSR-4 test namespaces and suite namespace config - Custom base TestCase with DI Container integration pattern - dump.sql best practices (keep minimal, tests create own data) - GitHub Actions PHP version matrix example
Co-authored-by: Justin <defunctl@users.noreply.github.com>
Per review feedback from defunctl: the test_ prefix is less noise and less work than @test annotations (no docblock needed). Updated all code examples across skill files to use test_ prefix, and flipped the recommendation in test-anatomy.md to list test_ prefix as the preferred style.
When `slic here` runs from a themes directory (no wp-config.php), detect a sibling `plugins/` directory and set SLIC_THEMES_DIR to the current directory and SLIC_PLUGINS_DIR to the sibling. This makes SLIC_HERE_DIR === SLIC_THEMES_DIR so get_project_type() resolves theme targets without a manual .env.slic.run edit. Guarded with a `basename === 'themes'` check so running `slic here` from `wp-content/plugins` does not falsely enter themes mode. Covers standard WordPress (wp-content/) and Bedrock (content/) layouts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add Agent Skills for AI-assisted WordPress test writing
feat: add first-class theme support for slic here and slic run
defunctl
marked this pull request as ready for review
May 29, 2026 20:43
defunctl
requested review from
bordoni,
claudiosanches,
dpanta94,
mauteri and
skyshab
May 29, 2026 20:43
mauteri
approved these changes
May 29, 2026
dpanta94
approved these changes
May 29, 2026
dpanta94
left a comment
Member
There was a problem hiding this comment.
Im not reading through the skills which i think we should move them to their own repo.
Other than that it looks good!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add PHP 8.4 + 8.5 Images
peclstill, so for >= 8.4, we need to build it from source. The Dockerfile has been updated to reflect this. It was last updated in 2021, so if it ever gets updated, we can remove the git clone logic: https://pecl.php.net/package/uopzpublic.ecr.awsimage repository so we no longer get rate limited by docker.Main Changes
In addition to the merged PR's, this provides a number of changes to the
themefunctionality.Refactor Summary
Refactored slic target path resolution to be target-aware instead of mode-aware.
Previously,
get_project_local_path()andget_project_container_path()inferred paths from the globalslic heremode. That broke once a single slic context could expose both plugin and theme targets.This refactor adds
get_target_content_type()and updates the project path helpers so each selected target resolves independently as a plugin, theme, or site target.Notable Changes
SLIC_CURRENT_PROJECT_CONTAINER_PATHso container-side tooling can use the resolved target path directly.SLIC_HERE_DIRto preserve site/WP skeleton behavior.slic runnow repairs stale or incomplete WordPress.htaccessrewrite blocks in the configuredSLIC_WP_DIR, preventing Apache-level 404s for pretty REST API URLs.