Skip to content

Feature/prompt Templates#6

Merged
jasperf merged 8 commits into
mainfrom
feature/prompt-templates
May 24, 2026
Merged

Feature/prompt Templates#6
jasperf merged 8 commits into
mainfrom
feature/prompt-templates

Conversation

@jasperf
Copy link
Copy Markdown
Contributor

@jasperf jasperf commented May 24, 2026

This pull request introduces prompt template support to the Waygate plugin's AI integration layer and admin interface, releasing as version 0.6.0 with 670 net line additions across 16 files. The feature allows users to select and apply pre-defined prompt templates when generating pages, giving more control over AI output without requiring manual prompt authoring. Alongside the feature work, all PHP classes were renamed to WordPress underscore convention (e.g., PatternLabPattern_Lab), and a phpcs.xml configuration was added with all resulting coding standard violations resolved. Unit test coverage was extended to validate the new template behavior, and the .vibe tooling configuration was committed to the repository to standardize AI-assisted development workflows.

Prompt Templates and AI Integration:

  • Added prompt template selection to class-ai-integration.php, enabling structured prompt variants to be passed into the AI generation pipeline alongside the pattern catalog.
  • Extended the admin UI in class-admin.php to expose template selection in the page generation form, connecting user-facing template choices to the underlying AI request.

Code Quality and Standards:

  • Added phpcs.xml to define project-level PHP CodeSniffer rules, and resolved all pre-existing violations across class-abilities-api.php, class-admin.php, class-ai-integration.php, and class-pattern-lab.php.
  • Renamed all plugin classes to WordPress underscore naming convention, aligning with WordPress core standards and ensuring consistency with the broader ecosystem.

Testing and Developer Tooling:

  • Added prompt template unit tests in AiIntegrationTest.php and extended tests/bootstrap.php with additional stubs required by the new template code paths.
  • Committed .vibe/config.toml and .vibe/prompts/vibe.md to version control, establishing a shared baseline for AI-assisted development tooling used within this project.

Documentation and Roadmap:

  • Updated CHANGELOG.md and README.md to reflect the v0.6.0 release, documenting the prompt template feature and the class renaming refactor.
  • Marked Phase 1 complete in docs/ROADMAP.md and designated Phase 2 as the active development focus.

Files Changed:

jasperf added 8 commits May 24, 2026 15:08
Add six built-in prompt templates (Homepage, About, Services, Contact,
Landing, Portfolio) to AiIntegration::get_prompt_templates(), filterable
via the waygate_prompt_templates hook.

Add a Quick Template dropdown to the admin form that pre-fills the
description textarea on selection. A confirmation prompt fires if the
textarea already has content, then resets the select so re-selection
still works. Description hint now notes [placeholder] substitution.
Add phpcs.xml to declare WordPress standard and suppress the
InvalidClassFileName sniff (WordPress convention uses hyphens in
file names for multi-word classes, e.g. class-pattern-lab.php).

Fix pre-existing violations across all plugin files:
- Add missing file, class, and method doc comments
- Convert short array syntax to long form (phpcbf auto-fix)
- Fix Yoda condition in Admin::render_page()
- Add sanitize_textarea_field() to textarea echo in admin form
- Add @Package tag to waygate.php file header

Update CLAUDE.md to use the bare `vendor/bin/phpcs` command so
phpcs.xml is picked up automatically.
Add five tests for AiIntegration::get_prompt_templates():
- returns an array
- has all six expected template keys
- each template has non-empty label, description, and prompt fields
- filter hook allows third parties to add templates
- homepage template prompt contains [industry] placeholder

Add remove_all_filters() stub to the test bootstrap so filter
teardown in tests works without a full WordPress environment.
All four Phase 1 items are confirmed shipped as of 2026-05-24:
feature detection, ability annotations, generic pattern prefix filter,
and category filter dropdown in admin UI.

Update Implementation Priority to start Phase 2 with prompt templates
(now done), followed by REST API, client-side abilities, image
generation, and batch page creation.
Track Vibe CLI project configuration (.vibe/) alongside the existing
.claude/ tooling. Excluded from Composer archive via composer.json so
it does not ship to end users via Packagist.
Update Version header and WAYGATE_VERSION constant in waygate.php.
Add .vibe/ to composer.json archive excludes.
Add 0.6.0 release notes covering prompt templates, Quick Template
dropdown, waygate_prompt_templates filter, new unit tests, and
phpcs.xml. Bump version badge in README and add prompt templates
to the feature list.
Pattern_Lab, Abilities_API, AI_Integration replace PatternLab,
AbilitiesApi, AiIntegration to comply with WordPress coding standards
and unblock WordPress.org submission. Removes the
InvalidClassFileName PHPCS exclusion — renamed classes pass cleanly.
@jasperf jasperf merged commit 7a160b8 into main May 24, 2026
2 checks passed
@jasperf jasperf deleted the feature/prompt-templates branch May 24, 2026 08:30
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.

1 participant