create-query

Generate Elasticsearch Query classes, exceptions, and tests for PHP projects.

66|2|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/bonu-dev/php-elasticsearch-builder --skill create-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-query
Source: https://github.com/bonu-dev/php-elasticsearch-builder/tree/main/.agents/skills/create-query
Command: npx skills add https://github.com/bonu-dev/php-elasticsearch-builder --skill create-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates standardized Elasticsearch Query classes, exceptions, and tests to accelerate feature development within a PHP project. It enforces project conventions such as immutability, PHPDoc, and trait usage, and streamlines the creation of new query types.

Core Features & Use Cases

  • Generates a new Query class implementing the project's QueryInterface with standard traits (BoostableQuery, AnalyzerAwareQuery as needed).
  • Creates corresponding exception classes and unit tests, all wired to adhere to immutability and PHPDoc conventions.
  • Ideal for when you need to add, implement, or create a new query type (e.g., fuzzy, wildcard, prefix) with full project conformity.

Quick Start

Ask me to create a new Elasticsearch Query class for a given query type, and I will generate the class, exception, tests, and required CI-compliant files.

Frequently Asked Questions about create-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Elasticsearch Query classes in PHP automatically?

You can scaffold standardized Elasticsearch Query classes in PHP by requesting a specific query type, which generates the class, exception, and PHPUnit tests while enforcing immutability, PHPDoc, and project conventions.

What is the best way to add a new Elasticsearch query type like fuzzy or wildcard in PHP?

To add a new Elasticsearch query type like fuzzy or wildcard, you scaffold it using code generation to create the Query class, exception, and tests, ensuring the implementation uses standard traits like BoostableQuery and AnalyzerAwareQuery.

Do I need PHP 8.4 and PHPUnit to scaffold Elasticsearch query classes?

Yes, you need PHP 8.4+, PHPUnit, and PHPStan to scaffold Elasticsearch query classes, as the generated files and tests are wired to adhere to these specific environment conventions and CI-compliant standards.

Does Elasticsearch query code generation enforce immutability and PHPDoc conventions?

Yes, Elasticsearch query code generation enforces immutability and PHPDoc conventions by applying a standardized template that implements QueryInterface and includes standard traits like BoostableQuery and AnalyzerAwareQuery as needed.

Can I generate unit tests and exceptions alongside my PHP Elasticsearch query classes?

Yes, you can generate unit tests and exception classes alongside your PHP Elasticsearch query classes, as the code-generation template outputs all required CI-compliant files to accelerate feature development.