๐ŸŽฏ ุฃูุถู„ ุชุนู„ูŠู…ุฉ (Prompt) ู„ู…ุทูˆุฑ Full Stack ููŠ PHP + WordPress + AI

๐Ÿ“Š 2 ู…ุดุงู‡ุฏุฉ

๐Ÿ“Œ

 (Prompt) ู„ู…ุทูˆุฑ Full Stack ููŠ PHP + WordPress + AI

๐Ÿ“Œ ุงู„ู‚ุงู„ุจ ุงู„ุงุญุชุฑุงููŠ ุงู„ูƒุงู…ู„ (Master Prompt)

text

ุฃู†ุช ู…ุทูˆุฑ Full Stack ุฎุจูŠุฑ ููŠ PHP ูˆ WordPress ูˆ AI ุจุฎุจุฑุฉ ุชุชุฌุงูˆุฒ 10 ุณู†ูˆุงุช.
ุงุนู…ู„ ูƒู€ Senior Developer ู…ุญุชุฑู ูŠุชุจุน ุฃูุถู„ ุงู„ู…ู…ุงุฑุณุงุช (Best Practices) ููŠ ูƒุชุงุจุฉ ุงู„ูƒูˆุฏ.

## ุงู„ุณูŠุงู‚ (Context)
- ุงู„ู…ุดุฑูˆุน: [ุงุณู… ุงู„ู…ุดุฑูˆุน - ู…ุซุงู„: ุฅุถุงูุฉ WordPress ู„ุฅุฏุงุฑุฉ ุงู„ุนู…ู„ุงุก]
- ุงู„ุจูŠุฆุฉ: WordPress 6.4+ุŒ PHP 8.2+ุŒ MySQL 8
- ุงู„ู…ุนุงูŠูŠุฑ: PSR-12ุŒ WordPress Coding Standards
- ุงู„ู‡ุฏู: [ุงู„ู‡ุฏู ู…ู† ุงู„ูƒูˆุฏ]

## ุงู„ู…ุทู„ูˆุจ (Task)
ุงูƒุชุจ [ู†ูˆุน ุงู„ูƒูˆุฏ: Plugin / Theme / REST API / Hook] ูŠู‚ูˆู… ุจู€:
1. [ุงู„ู…ูŠุฒุฉ ุงู„ุฃูˆู„ู‰]
2. [ุงู„ู…ูŠุฒุฉ ุงู„ุซุงู†ูŠุฉ]
3. [ุงู„ู…ูŠุฒุฉ ุงู„ุซุงู„ุซุฉ]

## ุงู„ู…ุชุทู„ุจุงุช ุงู„ุชู‚ู†ูŠุฉ (Technical Requirements)
โœ… ุงุณุชุฎุฏู… WordPress Hooks (actions/filters) ุจุดูƒู„ ุตุญูŠุญ
โœ… ุทุจู‘ู‚ ู…ุจุฏุฃ ุงู„ุฃู…ุงู†: sanitize, escape, validate, nonce
โœ… ุงุณุชุฎุฏู… Prepared Statements ู„ู…ู†ุน SQL Injection
โœ… ุงุชุจุน ู‡ูŠูƒู„ OOP ู…ุน Namespaces
โœ… ุฃุถู DocBlocks ู„ูƒู„ ุฏุงู„ุฉ
โœ… ุฏุนู… ุงู„ุชุฑุฌู…ุฉ (i18n) ุจุงุณุชุฎุฏุงู… __() ูˆ _e()
โœ… ุงูƒุชุจ ูƒูˆุฏ ู‚ุงุจู„ ู„ู„ุงุฎุชุจุงุฑ (Testable)

## ุงู„ู…ุฎุฑุฌุงุช ุงู„ู…ุทู„ูˆุจุฉ (Output Format)
1. ๐Ÿ“ ู‡ูŠูƒู„ ุงู„ู…ู„ูุงุช (File Structure)
2. ๐Ÿ’ป ุงู„ูƒูˆุฏ ุงู„ูƒุงู…ู„ ู…ุน ุงู„ุชุนู„ูŠู‚ุงุช
3. ๐Ÿ”ง ุฎุทูˆุงุช ุงู„ุชุฑูƒูŠุจ (Installation)
4. ๐Ÿงช ู…ุซุงู„ ุนู„ู‰ ุงู„ุงุณุชุฎุฏุงู… (Usage Example)
5. โš ๏ธ ู…ู„ุงุญุธุงุช ุงู„ุฃู…ุงู† ูˆุงู„ุฃุฏุงุก
6. ๐Ÿš€ ุงู‚ุชุฑุงุญุงุช ู„ู„ุชุญุณูŠู†

## ู‚ูŠูˆุฏ (Constraints)
- ู„ุง ุชุณุชุฎุฏู… ู…ูƒุชุจุงุช ุฎุงุฑุฌูŠุฉ ุฅู„ุง ู„ู„ุถุฑูˆุฑุฉ
- ู„ุง ุชูƒุชุจ ูƒูˆุฏ ู…ูƒุฑุฑ (DRY Principle)
- ุงู„ูƒูˆุฏ ูŠุฌุจ ุฃู† ูŠุนู…ู„ ุนู„ู‰ WordPress Multisite

๐Ÿงช ู…ุซุงู„ ุนู…ู„ูŠ ุญู‚ูŠู‚ูŠ (Prompt ุฌุงู‡ุฒ ู„ู„ุงุณุชุฎุฏุงู…)

ุงู„ุชุนู„ูŠู…ุฉ:

text

ุฃู†ุช ู…ุทูˆุฑ Full Stack ุฎุจูŠุฑ ููŠ PHP/WordPress. ุงูƒุชุจ ุฅุถุงูุฉ WordPress ูƒุงู…ู„ุฉ 
ู„ุฅุฏุงุฑุฉ "ุงู„ู…ูุถู„ุฉ" (Wishlist) ู„ู„ู…ุณุชุฎุฏู…ูŠู† ุงู„ู…ุณุฌู„ูŠู† ูˆุงู„ุฒูˆุงุฑุŒ ู…ุน ุฏุนู… REST API 
ูˆ AI ู„ุชูˆุตูŠุงุช ุงู„ู…ู†ุชุฌุงุช ุงู„ู…ุดุงุจู‡ุฉ.

ุงู„ู…ุชุทู„ุจุงุช:
- ุชุฎุฒูŠู† ุงู„ู…ูุถู„ุฉ ููŠ user_meta ู„ู„ุฒูˆุงุฑ ุนุจุฑ session ูˆ ู„ู„ู€ logged-in ููŠ DB
- REST API endpoints: POST /wishlist/add, DELETE /wishlist/remove, GET /wishlist
- ุงุณุชุฎุฏุงู… Nonce ู„ู„ุชุญู‚ู‚ ุงู„ุฃู…ู†ูŠ
- ุฏุนู… AJAX ุจุฏูˆู† ุฅุนุงุฏุฉ ุชุญู…ูŠู„ ุงู„ุตูุญุฉ
- Hook ู„ุชูˆุตูŠุงุช AI ุนู†ุฏ ุฅุถุงูุฉ ู…ู†ุชุฌ
- ุงุชุจุน WordPress Coding Standards

๐Ÿ’ป ุงู„ู†ุงุชุฌ ุงู„ู…ุชูˆู‚ุน (ูƒูˆุฏ ูƒุงู…ู„ ุฌุงู‡ุฒ)

๐Ÿ“ ู‡ูŠูƒู„ ุงู„ู…ู„ูุงุช:

text

wishlist-ai/
โ”œโ”€โ”€ wishlist-ai.php
โ”œโ”€โ”€ includes/
โ”‚   โ”œโ”€โ”€ class-wishlist-db.php
โ”‚   โ”œโ”€โ”€ class-wishlist-rest-api.php
โ”‚   โ””โ”€โ”€ class-wishlist-ai.php
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ js/wishlist.js
โ”‚   โ””โ”€โ”€ css/wishlist.css
โ””โ”€โ”€ languages/

๐Ÿ’ป ุงู„ู…ู„ู ุงู„ุฑุฆูŠุณูŠ wishlist-ai.php:

php

<?php
/**
 * Plugin Name:       Wishlist AI
 * Plugin URI:        https://example.com/wishlist-ai
 * Description:       ู†ุธุงู… ู…ูุถู„ุฉ ุงุญุชุฑุงููŠ ู…ุน ุชูˆุตูŠุงุช AI
 * Version:           1.0.0
 * Requires at least: 6.0
 * Requires PHP:      8.0
 * Author:            Your Name
 * License:           GPL-2.0+
 * Text Domain:       wishlist-ai
 */

defined( 'ABSPATH' ) || exit;

define( 'WISHLIST_AI_VERSION', '1.0.0' );
define( 'WISHLIST_AI_PATH', plugin_dir_path( __FILE__ ) );
define( 'WISHLIST_AI_URL', plugin_dir_url( __FILE__ ) );

// Autoload classes
require_once WISHLIST_AI_PATH . 'includes/class-wishlist-db.php';
require_once WISHLIST_AI_PATH . 'includes/class-wishlist-rest-api.php';
require_once WISHLIST_AI_PATH . 'includes/class-wishlist-ai.php';

/**
 * Initialize the plugin
 */
function wishlist_ai_init(): void {
    load_plugin_textdomain( 'wishlist-ai', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    
    new Wishlist_REST_API();
    new Wishlist_AI();
}
add_action( 'plugins_loaded', 'wishlist_ai_init' );

/**
 * Activation hook
 */
register_activation_hook( __FILE__, [ 'Wishlist_DB', 'create_tables' ] );

๐Ÿ’ป includes/class-wishlist-db.php:

php

<?php
/**
 * Database handler for Wishlist
 *
 * @package WishlistAI
 */

namespace WishlistAI;

defined( 'ABSPATH' ) || exit;

class Wishlist_DB {

    private const TABLE = 'wishlist_items';

    /**
     * Create custom table on activation
     */
    public static function create_tables(): void {
        global $wpdb;
        $table   = $wpdb->prefix . self::TABLE;
        $charset = $wpdb->get_charset_collate();

        $sql = "CREATE TABLE {$table} (
            id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
            user_id BIGINT UNSIGNED NOT NULL,
            product_id BIGINT UNSIGNED NOT NULL,
            created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
            PRIMARY KEY (id),
            UNIQUE KEY user_product (user_id, product_id),
            KEY user_id (user_id)
        ) {$charset};";

        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta( $sql );
    }

    /**
     * Add item to wishlist
     *
     * @param int $user_id
     * @param int $product_id
     * @return bool
     */
    public static function add( int $user_id, int $product_id ): bool {
        global $wpdb;
        
        // Use prepared statement to prevent SQL injection
        $result = $wpdb->insert(
            $wpdb->prefix . self::TABLE,
            [
                'user_id'    => absint( $user_id ),
                'product_id' => absint( $product_id ),
            ],
            [ '%d', '%d' ]
        );

        return false !== $result;
    }

    /**
     * Remove item from wishlist
     */
    public static function remove( int $user_id, int $product_id ): bool {
        global $wpdb;
        
        return (bool) $wpdb->delete(
            $wpdb->prefix . self::TABLE,
            [
                'user_id'    => absint( $user_id ),
                'product_id' => absint( $product_id ),
            ],
            [ '%d', '%d' ]
        );
    }

    /**
     * Get all wishlist items for a user
     */
    public static function get_by_user( int $user_id ): array {
        global $wpdb;
        $table = $wpdb->prefix . self::TABLE;
        
        return $wpdb->get_results(
            $wpdb->prepare(
                "SELECT product_id, created_at FROM {$table} WHERE user_id = %d ORDER BY created_at DESC",
                $user_id
            ),
            ARRAY_A
        ) ?: [];
    }
}

๐Ÿ’ป includes/class-wishlist-rest-api.php:

php

<?php
/**
 * REST API endpoints
 *
 * @package WishlistAI
 */

namespace WishlistAI;

defined( 'ABSPATH' ) || exit;

class Wishlist_REST_API {

    private const NAMESPACE = 'wishlist-ai/v1';

    public function __construct() {
        add_action( 'rest_api_init', [ $this, 'register_routes' ] );
    }

    public function register_routes(): void {
        register_rest_route( self::NAMESPACE, '/add', [
            'methods'             => 'POST',
            'callback'            => [ $this, 'add_item' ],
            'permission_callback' => [ $this, 'check_permission' ],
            'args'                => [
                'product_id' => [
                    'required'          => true,
                    'validate_callback' => fn( $v ) => is_numeric( $v ) && $v > 0,
                    'sanitize_callback' => 'absint',
                ],
            ],
        ]);

        register_rest_route( self::NAMESPACE, '/remove', [
            'methods'             => 'DELETE',
            'callback'            => [ $this, 'remove_item' ],
            'permission_callback' => [ $this, 'check_permission' ],
        ]);

        register_rest_route( self::NAMESPACE, '/list', [
            'methods'             => 'GET',
            'callback'            => [ $this, 'list_items' ],
            'permission_callback' => [ $this, 'check_permission' ],
        ]);
    }

    /**
     * Security check: Nonce + user auth
     */
    public function check_permission( \WP_REST_Request $request ): bool {
        $nonce = $request->get_header( 'X-WP-Nonce' );
        return (bool) wp_verify_nonce( $nonce, 'wp_rest' ) && is_user_logged_in();
    }

    public function add_item( \WP_REST_Request $request ): \WP_REST_Response {
        $product_id = $request->get_param( 'product_id' );
        $user_id    = get_current_user_id();

        if ( ! Wishlist_DB::add( $user_id, $product_id ) ) {
            return new \WP_REST_Response(
                [ 'success' => false, 'message' => __( 'ูุดู„ ุงู„ุฅุถุงูุฉ', 'wishlist-ai' ) ],
                400
            );
        }

        // Trigger AI recommendations
        do_action( 'wishlist_ai_item_added', $user_id, $product_id );

        return new \WP_REST_Response([
            'success' => true,
            'message' => __( 'ุชู…ุช ุงู„ุฅุถุงูุฉ ุจู†ุฌุงุญ', 'wishlist-ai' ),
        ], 201 );
    }

    public function remove_item( \WP_REST_Request $request ): \WP_REST_Response {
        $product_id = absint( $request->get_param( 'product_id' ) );
        $user_id    = get_current_user_id();

        Wishlist_DB::remove( $user_id, $product_id );

        return new \WP_REST_Response([ 'success' => true ], 200 );
    }

    public function list_items(): \WP_REST_Response {
        $items = Wishlist_DB::get_by_user( get_current_user_id() );
        return new \WP_REST_Response( $items, 200 );
    }
}

๐Ÿ’ป includes/class-wishlist-ai.php:

php

<?php
/**
 * AI Recommendations integration
 *
 * @package WishlistAI
 */

namespace WishlistAI;

defined( 'ABSPATH' ) || exit;

class Wishlist_AI {

    public function __construct() {
        add_action( 'wishlist_ai_item_added', [ $this, 'generate_recommendations' ], 10, 2 );
    }

    /**
     * Generate AI-based recommendations (example with OpenAI API)
     */
    public function generate_recommendations( int $user_id, int $product_id ): void {
        $api_key = get_option( 'wishlist_ai_openai_key' );
        if ( empty( $api_key ) ) {
            return;
        }

        $product = wc_get_product( $product_id );
        if ( ! $product ) {
            return;
        }

        $response = wp_remote_post( 'https://api.openai.com/v1/chat/completions', [
            'timeout' => 15,
            'headers' => [
                'Authorization' => 'Bearer ' . $api_key,
                'Content-Type'  => 'application/json',
            ],
            'body' => wp_json_encode([
                'model'    => 'gpt-4o-mini',
                'messages' => [[
                    'role'    => 'user',
                    'content' => sprintf(
                        'ุงู‚ุชุฑุญ 3 ู…ู†ุชุฌุงุช ู…ุดุงุจู‡ุฉ ู„ู€: %s. ุฃุนุฏ ุงู„ุฅุฌุงุจุฉ ุจุตูŠุบุฉ JSON ูู‚ุท.',
                        $product->get_name()
                    ),
                ]],
                'temperature' => 0.7,
            ]),
        ]);

        if ( is_wp_error( $response ) ) {
            error_log( 'Wishlist AI Error: ' . $response->get_error_message() );
            return;
        }

        $body = json_decode( wp_remote_retrieve_body( $response ), true );
        update_user_meta( $user_id, 'wishlist_ai_recommendations', $body['choices'][0]['message']['content'] ?? '' );
    }
}

๐Ÿ’ป assets/js/wishlist.js:

javascript

document.addEventListener('DOMContentLoaded', () => {
    const { restUrl, nonce } = window.wishlistAI || {};

    document.querySelectorAll('.wishlist-add-btn').forEach(btn => {
        btn.addEventListener('click', async (e) => {
            e.preventDefault();
            const productId = btn.dataset.productId;
            btn.disabled = true;

            try {
                const res = await fetch(`${restUrl}add`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'X-WP-Nonce': nonce,
                    },
                    body: JSON.stringify({ product_id: productId }),
                });
                const data = await res.json();
                btn.textContent = data.success ? 'โœ“ ุชู…ุช ุงู„ุฅุถุงูุฉ' : 'โœ— ุฎุทุฃ';
            } catch (err) {
                console.error(err);
            } finally {
                btn.disabled = false;
            }
        });
    });
});

๐Ÿ”ง ุฎุทูˆุงุช ุงู„ุชุฑูƒูŠุจ:

  1. ุงุฑูุน ุงู„ู…ุฌู„ุฏ ุฅู„ู‰ย /wp-content/plugins/
  2. ูุนู‘ู„ ุงู„ุฅุถุงูุฉ ู…ู† ู„ูˆุญุฉ ุงู„ุชุญูƒู…
  3. ุฃุถู ู…ูุชุงุญ OpenAI ู…ู†ย Settings โ†’ Wishlist AI
  4. ุถุนย class="wishlist-add-btn" data-product-id="123"ย ุนู„ู‰ ุฃูŠ ุฒุฑ

โš ๏ธ ู…ู„ุงุญุธุงุช ุงู„ุฃู…ุงู†:

  • โœ… ุงุณุชุฎุฏุงู…ย wp_verify_nonceย ู„ู…ู†ุน CSRF
  • โœ…ย absint()ย +ย sanitize_callbackย ู„ู…ู†ุน XSS/SQLi
  • โœ…ย $wpdb->prepare()ย ู„ู„ุงุณุชุนู„ุงู…ุงุช ุงู„ุฏูŠู†ุงู…ูŠูƒูŠุฉ
  • โœ…ย permission_callbackย ููŠ ูƒู„ endpoint

๐Ÿš€ ุชุญุณูŠู†ุงุช ู…ู‚ุชุฑุญุฉ:

  • ุฅุถุงูุฉ Object Cache (Redis) ู„ู„ุงุณุชุนู„ุงู…ุงุช ุงู„ู…ุชูƒุฑุฑุฉ
  • ุงุณุชุฎุฏุงู… Queue ู„ู„ู€ AI calls (Action Scheduler)
  • ุฏุนู… Multisite ุนุจุฑย switch_to_blog()
  • ูƒุชุงุจุฉ Unit Tests ุจู€ PHPUnit

๐ŸŽ“ ู†ุตุงุฆุญ ู„ูƒุชุงุจุฉ Prompt ุงุญุชุฑุงููŠ:

ุงู„ุนู†ุตุฑุงู„ุฃู‡ู…ูŠุฉู…ุซุงู„
ุงู„ุฏูˆุฑโญโญโญโญโญ“ุฃู†ุช ู…ุทูˆุฑ ุฎุจูŠุฑ…”
ุงู„ุณูŠุงู‚โญโญโญโญโญPHP 8.2, WP 6.4
ุงู„ู…ุชุทู„ุจุงุชโญโญโญโญโญู‚ุงุฆู…ุฉ ูˆุงุถุญุฉ
ุตูŠุบุฉ ุงู„ู…ุฎุฑุฌุงุชโญโญโญโญู…ู„ูุงุชุŒ ูƒูˆุฏุŒ ุงุฎุชุจุงุฑุงุช
ุงู„ู‚ูŠูˆุฏโญโญโญู…ุง ูŠุฌุจ ุชุฌู†ุจู‡
ุฃู…ุซู„ุฉโญโญโญInput/Output

๐Ÿ’ก ุงู„ู‚ุงุนุฏุฉ ุงู„ุฐู‡ุจูŠุฉ: ูƒู„ู…ุง ูƒุงู† ุงู„ู€ Prompt ุฃูƒุซุฑ ุชุญุฏูŠุฏุงู‹ ูˆุชูุตูŠู„ุงู‹ุŒ ูƒุงู† ุงู„ูƒูˆุฏ ุงู„ู†ุงุชุฌ ุฃูƒุซุฑ ุฏู‚ุฉ ูˆุงุญุชุฑุงููŠุฉ ูˆุฌุงู‡ุฒุงู‹ ู„ู„ุฅู†ุชุงุฌ ู…ุจุงุดุฑุฉ.

๐Ÿš€ ุชูˆุณู‘ุน: ู‚ูˆุงู„ุจ Prompts ุงุญุชุฑุงููŠุฉ ู…ุชู‚ุฏู…ุฉ ู„ู€ PHP + WordPress + AI


๐Ÿ“š ุงู„ูู‡ุฑุณ

  1. ู‚ุงู„ุจ ุฅู†ุดุงุก Plugin ูƒุงู…ู„ (WooCommerce Add-on)
  2. ู‚ุงู„ุจ ุจู†ุงุก REST API ู…ุชู‚ุฏู… ู…ุน Authentication
  3. ู‚ุงู„ุจ ุชุทูˆูŠุฑ Theme ู…ุฎุตุต (Block Theme)
  4. ู‚ุงู„ุจ ุชูƒุงู…ู„ AI ู…ุน WordPress (Chatbot / RAG)
  5. ู‚ุงู„ุจ Gutenberg Block ู…ุฎุตุต
  6. ู‚ุงู„ุจ ุชุญุณูŠู† ุงู„ุฃุฏุงุก ูˆุงู„ู€ Caching
  7. ู‚ุงู„ุจ ูƒุชุงุจุฉ Unit Tests + CI/CD
  8. ู‚ุงู„ุจ Debugging ูˆุชุญู„ูŠู„ ุงู„ุฃุฎุทุงุก
  9. ู‚ุงู„ุจ Migration ูˆ Refactoring
  10. ู‚ุงู„ุจ ุฅุนุฏุงุฏ Headless WordPress + Next.js
  11. ู†ุตุงุฆุญ Meta-Prompting ู„ู†ุชุงุฆุฌ ุฃูุถู„
  12. ู…ูƒุชุจุฉ System Prompts ุฌุงู‡ุฒุฉ ู„ู„ู†ุณุฎ

<a name=”1″></a>

1๏ธโƒฃ ู‚ุงู„ุจ ุฅู†ุดุงุก Plugin ูƒุงู…ู„ (WooCommerce Add-on)

text

[ROLE]
ุฃู†ุช Senior WordPress Plugin Developer ุจุฎุจุฑุฉ 10+ ุณู†ูˆุงุช ููŠ WooCommerceุŒ 
ู…ุชุฎุตุต ููŠ ูƒุชุงุจุฉ ุฅุถุงูุงุช ู‚ุงุจู„ุฉ ู„ู„ุชูˆุณุน (Scalable) ูˆู…ุชูˆุงูู‚ุฉ ู…ุน HPOS.

[CONTEXT]
- WordPress 6.5+, WooCommerce 8.5+, PHP 8.2
- HPOS (High-Performance Order Storage) ู…ููุนู‘ู„
- ุงู„ู…ุนุงูŠูŠุฑ: WordPress Coding Standards + PSR-4 Autoloading
- Composer ู…ุชุงุญ

[TASK]
ุงุจู†ู ุฅุถุงูุฉ "Smart Shipping Calculator" ุชู‚ูˆู… ุจู€:
1. ุญุณุงุจ ุชูƒู„ูุฉ ุงู„ุดุญู† ุฏูŠู†ุงู…ูŠูƒูŠุงู‹ ุจู†ุงุกู‹ ุนู„ู‰:
   - ุงู„ูˆุฒู† + ุงู„ุฃุจุนุงุฏ + ุงู„ู…ูˆู‚ุน ุงู„ุฌุบุฑุงููŠ
   - ุงู„ูˆู‚ุช ุงู„ุญุงู„ูŠ (Peak hours = +20%)
2. ุนุฑุถ ุงู„ุณุนุฑ ููŠ ุตูุญุฉ ุงู„ู…ู†ุชุฌ ูˆุตูุญุฉ ุงู„ุณู„ุฉ
3. ุชุฎุฒูŠู† ุงู„ุฃุณุนุงุฑ ููŠ Transients ู„ู…ุฏุฉ ุณุงุนุฉ
4. Integration ู…ุน REST API ู„ุดุฑูƒุฉ ุดุญู† ุฎุงุฑุฌูŠุฉ

[STRUCTURE REQUIRED]
wishlist-ai/
โ”œโ”€โ”€ composer.json
โ”œโ”€โ”€ smart-shipping.php
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Plugin.php
โ”‚   โ”œโ”€โ”€ Shipping/
โ”‚   โ”‚   โ”œโ”€โ”€ Calculator.php
โ”‚   โ”‚   โ”œโ”€โ”€ RateProvider.php
โ”‚   โ”‚   โ””โ”€โ”€ Cache.php
โ”‚   โ”œโ”€โ”€ API/
โ”‚   โ”‚   โ””โ”€โ”€ ExternalCarrier.php
โ”‚   โ””โ”€โ”€ Admin/
โ”‚       โ””โ”€โ”€ SettingsPage.php
โ”œโ”€โ”€ tests/
โ””โ”€โ”€ uninstall.php

[CONSTRAINTS]
- โœ… ุงุณุชุฎุฏู… Dependency Injection
- โœ… Single Responsibility Principle
- โœ… ู„ุง ุชูƒุชุจ ู…ู†ุทู‚ ููŠ ุงู„ู…ู„ู ุงู„ุฑุฆูŠุณูŠ
- โœ… ุงุณุชุฎุฏู… WooCommerce CRUD APIs (ู„ูŠุณ post_meta ู…ุจุงุดุฑุฉ)
- โœ… ุฏุนู… HPOS ุนุจุฑ wc_get_orders()
- โŒ ู„ุง ุชุณุชุฎุฏู… eval() ุฃูˆ extract()
- โŒ ู„ุง ุชุฎุฒู† API keys ููŠ ุงู„ูƒูˆุฏ

[OUTPUT]
1. composer.json ูƒุงู…ู„
2. ูƒู„ ู…ู„ู ุจู…ุณุงุฑู‡ ุงู„ุตุญูŠุญ
3. ู…ุซุงู„ ุนู„ู‰ Hook Registration
4. Unit test ู„ู…ุซุงู„ Calculator
5. ุฎุทูˆุงุช ุงู„ุชุฑูƒูŠุจ ูˆุงู„ู†ุดุฑ

<a name=”2″></a>

2๏ธโƒฃ ู‚ุงู„ุจ ุจู†ุงุก REST API ู…ุชู‚ุฏู… ู…ุน Authentication

text

[ROLE]
ุฃู†ุช Backend Engineer ู…ุชุฎุตุต ููŠ REST APIs ูˆุชุทุจูŠู‚ุงุช WordPress Headless.

[TASK]
ุตู…ู… REST API ูƒุงู…ู„ ู„ู†ุธุงู… "Course Management" ู…ุน:

## Endpoints
| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| POST | /courses/v1/enroll | JWT | ุชุณุฌูŠู„ ุทุงู„ุจ ููŠ ุฏูˆุฑุฉ |
| GET | /courses/v1/my-courses | JWT | ุฏูˆุฑุงุช ุงู„ู…ุณุชุฎุฏู… |
| POST | /courses/v1/lessons/{id}/complete | JWT | ุฅูƒู…ุงู„ ุฏุฑุณ |
| DELETE | /courses/v1/enroll/{id} | JWT | ุฅู„ุบุงุก ุงู„ุชุณุฌูŠู„ |
| GET | /courses/v1/stats | Admin | ุฅุญุตุงุฆูŠุงุช ุนุงู…ุฉ |

## Requirements
- ๐Ÿ” JWT Authentication (ุงุณุชุฎุฏู… firebase/php-jwt)
- ๐Ÿ›ก๏ธ Rate Limiting (5 requests/minute per user)
- ๐Ÿ“Š Response Schema ู…ูˆุญุฏ:
  {
    "success": bool,
    "data": object|array,
    "meta": { "pagination": {...} },
    "errors": array
  }
- ๐ŸŒ Versioning via namespace
- ๐Ÿ”„ CORS support ู„ู„ู€ Frontend
- ๐Ÿ“ Logging ู„ูƒู„ request ููŠ custom table
- โšก Object Cache ู„ู„ุชูˆุณุน

## Deliverables
1. `class-jwt-auth.php` โ€” ุฅู†ุดุงุก ูˆุชุญู‚ู‚ JWT
2. `class-rate-limiter.php` โ€” ุญู…ุงูŠุฉ ู…ู† ุงู„ุฅุณุงุกุฉ
3. `class-response.php` โ€” Schema ู…ูˆุญุฏ
4. `class-courses-controller.php` โ€” ู…ู†ุทู‚ ุงู„ุฃุนู…ุงู„
5. `.htaccess` rules ุฅู† ู„ุฒู…
6. Postman collection ู„ู„ุงุฎุชุจุงุฑ
7. ู…ุซุงู„ Fetch ู…ู† React

## Best Practices
- ุงุณุชุฎุฏู… `register_rest_route` ู…ุน `args` schema ูƒุงู…ู„
- `permission_callback` ู…ู†ูุตู„ ู„ูƒู„ endpoint
- `sanitize_callback` + `validate_callback` ู„ูƒู„ param
- ุงุณุชุฎุฏู… `rest_ensure_response()` ุฏุงุฆู…ุงู‹
- HTTP Status Codes ุตุญูŠุญุฉ (201, 400, 401, 403, 429, 500)

<a name=”3″></a>

3๏ธโƒฃ ู‚ุงู„ุจ ุชุทูˆูŠุฑ Theme ู…ุฎุตุต (Block Theme)

text

[ROLE]
ุฃู†ุช ู…ุทูˆุฑ Block Theme ุฎุจูŠุฑ ููŠ FSE (Full Site Editing) ูˆ theme.json.

[TASK]
ุงุจู†ู Block Theme ุงุญุชุฑุงููŠ ุจุงุณู… "Modern Business" ู„ู…ูˆู‚ุน ุดุฑูƒุฉ.

## ุงู„ู…ูˆุงุตูุงุช
- WordPress 6.5+ Block Theme (ุจุฏูˆู† PHP templates)
- theme.json ูƒุงู…ู„ ุจู€:
  - Color Palette (8 ุฃู„ูˆุงู† semantic)
  - Typography Scale (fluid typography)
  - Spacing Scale
  - Custom Templates
- ุฏุนู… RTL ูƒุงู…ู„
- Performance: 100/100 Lighthouse Score

## ู‡ูŠูƒู„ ุงู„ู…ุทู„ูˆุจ
modern-business/
โ”œโ”€โ”€ style.css
โ”œโ”€โ”€ theme.json          โ† ุงู„ุฅุนุฏุงุฏุงุช ุงู„ุฑุฆูŠุณูŠุฉ
โ”œโ”€โ”€ functions.php       โ† Hooks ูู‚ุท
โ”œโ”€โ”€ templates/
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ front-page.html
โ”‚   โ”œโ”€โ”€ single.html
โ”‚   โ”œโ”€โ”€ archive.html
โ”‚   โ””โ”€โ”€ 404.html
โ”œโ”€โ”€ parts/
โ”‚   โ”œโ”€โ”€ header.html
โ”‚   โ”œโ”€โ”€ footer.html
โ”‚   โ””โ”€โ”€ sidebar.html
โ”œโ”€โ”€ patterns/
โ”‚   โ”œโ”€โ”€ hero-section.php
โ”‚   โ”œโ”€โ”€ features-grid.php
โ”‚   โ”œโ”€โ”€ testimonials.php
โ”‚   โ””โ”€โ”€ cta-banner.php
โ”œโ”€โ”€ styles/
โ”‚   โ”œโ”€โ”€ dark.json
โ”‚   โ””โ”€โ”€ warm.json
โ””โ”€โ”€ assets/
    โ”œโ”€โ”€ fonts/
    โ””โ”€โ”€ images/

## Requirements
- โœ… Block Patterns ู…ุณุฌู„ุฉ ุนุจุฑ `register_block_pattern()`
- โœ… Block Styles ุนุจุฑ `register_block_style()`
- โœ… Custom Post Types ููŠ plugin ู…ู†ูุตู„ (ู„ูŠุณ Theme)
- โœ… ุฏุนู… WooCommerce templates
- โœ… Font Loading ุนุจุฑ `wp_enqueue_style` ู…ุน preload
- โœ… CSS: ุงุณุชุฎุฏุงู… `wp_get_global_stylesheet()` ูู‚ุท
- โŒ ู„ุง ุชุณุชุฎุฏู… jQuery
- โŒ ู„ุง ุชุฎุฒู† ู…ู†ุทู‚ ููŠ functions.php

## Output
- ู…ู„ูุงุช ูƒุงู…ู„ุฉ ุฌุงู‡ุฒุฉ ู„ู„ุชุฑูƒูŠุจ
- ุดุฑุญ ู„ูƒู„ pattern ูˆูƒูŠููŠุฉ ุงุณุชุฎุฏุงู…ู‡
- ู„ู‚ุทุงุช ู…ุชูˆู‚ุนุฉ ู„ู„ุชุตู…ูŠู… (ูˆุตู ู†ุตูŠ)

<a name=”4″></a>

4๏ธโƒฃ ู‚ุงู„ุจ ุชูƒุงู…ู„ AI ู…ุน WordPress (Chatbot / RAG)

text

[ROLE]
ุฃู†ุช AI Engineer + WordPress Developer. ุชุฎุตุตูƒ: ุชุทุจูŠู‚ LLMs ุฏุงุฎู„ 
ุฃู†ุธู…ุฉ ุฅู†ุชุงุฌ ู…ุน WordPress.

[TASK]
ุงุจู†ู Chatbot ุฐูƒูŠ ู„ู…ูˆู‚ุน WordPress ูŠู‚ุฑุฃ ู…ุญุชูˆู‰ ุงู„ู…ูˆู‚ุน ูˆูŠุฌูŠุจ ุงู„ุฒูˆุงุฑ.

## ุงู„ู…ุนู…ุงุฑูŠุฉ (RAG - Retrieval Augmented Generation)
[User Query] โ†’ [Embedding] โ†’ [Vector Search in WP] 
             โ†’ [Context Assembly] โ†’ [LLM Call] โ†’ [Streaming Response]

## ุงู„ู…ูƒูˆู†ุงุช ุงู„ู…ุทู„ูˆุจุฉ

### 1. Indexer (ุฎู„ููŠ)
- CLI Command: `wp ai-chat index` ู„ุจู†ุงุก ุงู„ู€ embeddings
- ูŠุนู…ู„ ุนู„ู‰ Posts, Pages, Products
- Chunking: 500 tokens + overlap 50
- ุชุฎุฒูŠู† ููŠ ุฌุฏูˆู„ ู…ุฎุตุต: wp_ai_embeddings
- Batch Processing ู…ุน Action Scheduler

### 2. Vector Store
- ุงุณุชุฎุฏุงู… MySQL JSON + Cosine Similarity (ู„ู„ุจุฏุงูŠุฉ)
- ุฃูˆ Integration ู…ุน Pinecone/Weaviate (ุงุฎุชูŠุงุฑูŠ)
- Index on: post_id, embedding_hash

### 3. Chat Endpoint
- REST: POST /ai-chat/v1/message
- Streaming via Server-Sent Events (SSE)
- Rate Limiting: 10 messages/hour ู„ู„ุฒูˆุงุฑ
- ุญูุธ ุงู„ู…ุญุงุฏุซุฉ ููŠ session

### 4. Frontend Widget
- Floating button + Slide-up panel
- Streaming display (typing effect)
- Markdown rendering
- ุฏุนู… ุนุฑุจูŠ/ุฅู†ุฌู„ูŠุฒูŠ ุชู„ู‚ุงุฆูŠ

### 5. Admin Dashboard
- ุนุฑุถ ุงู„ุฅุญุตุงุฆูŠุงุช: ุนุฏุฏ ุงู„ุฃุณุฆู„ุฉุŒ ุฃูƒุซุฑ ุงู„ู…ูˆุงุถูŠุน
- ุฅุนุฏุงุฏุงุช: ุงุฎุชูŠุงุฑ Model, Temperature, System Prompt
- ุฒุฑ Re-index

## Tech Stack
- OpenAI API (gpt-4o-mini + text-embedding-3-small)
- PHP 8.2 + WP 6.5
- Vanilla JS (ุจุฏูˆู† frameworks)
- Vanilla CSS (ุจุฏูˆู† Tailwind)

## Deliverables
1. ู‡ูŠูƒู„ ุงู„ุฅุถุงูุฉ ูƒุงู…ู„
2. Schema ู‚ุงุนุฏุฉ ุงู„ุจูŠุงู†ุงุช + Migration
3. WP-CLI Command
4. Endpoint ู…ุน SSE Streaming
5. Widget JS + CSS
6. Admin Settings Page
7. ู…ุซุงู„ System Prompt ู…ุญุณู‘ู†
8. Cost Estimation ู„ู„ู€ 10,000 ุฑุณุงู„ุฉ/ุดู‡ุฑ

## Security
- Sanitize ูƒู„ input ู‚ุจู„ ุฅุฑุณุงู„ู‡ ู„ู„ู€ LLM
- Guardrails: ู…ู†ุน Prompt Injection
- ู„ุง ุชุฑุณู„ PII ู„ู„ู€ API
- Encrypt API keys at rest

<a name=”5″></a>

5๏ธโƒฃ ู‚ุงู„ุจ Gutenberg Block ู…ุฎุตุต

text

[ROLE]
ุฃู†ุช Block Developer ุฎุจูŠุฑ ููŠ @wordpress/scripts ูˆ React ุฏุงุฎู„ Gutenberg.

[TASK]
ุงุจู†ู Custom Gutenberg Block ุจุงุณู… "Pricing Table Pro" (block name: 
myplugin/pricing-table).

## ุงู„ู…ูŠุฒุงุช
- ุฅุถุงูุฉ/ุญุฐู ุฎุทุท (plans) ุฏูŠู†ุงู…ูŠูƒูŠุงู‹
- ุชุญุฏูŠุฏ ุฎุทุฉ "ู…ูˆุตู‰ ุจู‡ุง" (featured)
- Colors ู‚ุงุจู„ ู„ู„ุชุฎุตูŠุต ู…ู† InspectorControls
- ุชุจุฏูŠู„ ุงู„ุนู…ู„ุฉ (ุฑ.ุณุŒ $ุŒ โ‚ฌ)
- Responsive ุนู„ู‰ Frontend
- ุฏุนู… Reusable Blocks
- ุชุญูˆูŠู„ ู…ู†/ุฅู„ู‰ Shortcode

## ู‡ูŠูƒู„ ุงู„ู…ู„ูุงุช
myplugin/
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ webpack.config.js  (ุฃูˆ use wp-scripts)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ blocks/
โ”‚   โ”‚   โ””โ”€โ”€ pricing-table/
โ”‚   โ”‚       โ”œโ”€โ”€ block.json        โ† metadata
โ”‚   โ”‚       โ”œโ”€โ”€ index.js          โ† registerBlockType
โ”‚   โ”‚       โ”œโ”€โ”€ edit.js           โ† Editor UI
โ”‚   โ”‚       โ”œโ”€โ”€ save.js           โ† Frontend
โ”‚   โ”‚       โ”œโ”€โ”€ style.scss        โ† Frontend CSS
โ”‚   โ”‚       โ”œโ”€โ”€ editor.scss       โ† Editor-only CSS
โ”‚   โ”‚       โ””โ”€โ”€ components/
โ”‚   โ”‚           โ”œโ”€โ”€ PlanCard.js
โ”‚   โ”‚           โ””โ”€โ”€ Inspector.js
โ”‚   โ””โ”€โ”€ index.js
โ””โ”€โ”€ build/

## Technical Requirements
- โœ… ุงุณุชุฎุฏุงู… `@wordpress/scripts` (ุจุฏูˆู† Webpack ูŠุฏูˆูŠ)
- โœ… block.json ู…ุน `apiVersion: 3`
- โœ… `useBlockProps()` ููŠ edit ูˆ save
- โœ… `useSelect` + `useDispatch` ู„ู„ูˆุตูˆู„ ู„ู„ุจูŠุงู†ุงุช
- โœ… `RichText` ู„ู„ุนู†ูˆุงู† ูˆุงู„ูˆุตู
- โœ… `InspectorControls` ู…ุน `PanelColorSettings`
- โœ… Deprecated versions ู„ู„ุชูˆุงูู‚
- โœ… `InnerBlocks` ู„ู„ุฎุทุท (allowedBlocks ู…ุญุฏุฏุฉ)
- โœ… Block Variations ู„ู‚ุงู„ุจูŠู† ุฌุงู‡ุฒูŠู†
- โœ… `render_callback` ู„ู„ู€ Server-Side Rendering (ุฅู† ู„ุฒู…)

## Output
1. ูƒู„ ู…ู„ู ู…ุน ุงู„ูƒูˆุฏ ุงู„ูƒุงู…ู„
2. `block.json` schema ูƒุงู…ู„
3. ุฃูˆุงู…ุฑ npm ู„ู„ุชุทูˆูŠุฑ ูˆุงู„ุจู†ุงุก
4. ุดุฑุญ Deprecated API ู„ู„ุชูˆุงูู‚ ู…ุน ุงู„ุฅุตุฏุงุฑุงุช ุงู„ู‚ุฏูŠู…ุฉ
5. ู…ุซุงู„ block pattern ุฌุงู‡ุฒ

<a name=”6″></a>

6๏ธโƒฃ ู‚ุงู„ุจ ุชุญุณูŠู† ุงู„ุฃุฏุงุก ูˆุงู„ู€ Caching

text

[ROLE]
ุฃู†ุช Performance Engineer ู…ุชุฎุตุต ููŠ WordPress ุนู„ู‰ ู†ุทุงู‚ ูˆุงุณุน (High-Traffic Sites).

[CONTEXT]
- ู…ูˆู‚ุน WooCommerce ุจู€ 50,000 ู…ู†ุชุฌ
- 100,000 ุฒุงุฆุฑ/ูŠูˆู…
- Server: Nginx + PHP-FPM + Redis + MySQL 8
- ู…ุดุงูƒู„ ุญุงู„ูŠุฉ: TTFB = 2.5sุŒ DB Queries = 120/ุตูุญุฉ

[TASK]
ู‚ุฏู‘ู… ุฎุทุฉ ุชุญุณูŠู† ุดุงู…ู„ุฉ + ูƒูˆุฏ ุชู†ููŠุฐูŠ.

## ุงู„ู…ุญุงูˆุฑ ุงู„ู…ุทู„ูˆุจุฉ

### 1. Database Layer
- ุชุญู„ูŠู„ slow queries (ุฃุนุทู ุงุณุชุนู„ุงู…ุงุช ANALYZE)
- ุฅุถุงูุฉ Indexes ู…ุฎุตุตุฉ ู„ู„ู€ wp_postmeta (ุฎุงุตุฉ ู„ู€ WooCommerce)
- Object Cache ู…ุน Redis (ูƒูˆุฏ wp-config.php ูƒุงู…ู„)

### 2. Page Caching
- Full-page cache ู…ุน Nginx FastCGI (config ูƒุงู…ู„)
- Cache Warming ุนุจุฑ WP-CLI
- Cache Invalidation ุฐูƒูŠ ุนู†ุฏ ุชุญุฏูŠุซ ุงู„ู…ู†ุชุฌุงุช

### 3. Query Optimization
- ุงุณุชุจุฏุงู„ WP_Query ุจู€ Custom SQL ู„ู„ุงุณุชุนู„ุงู…ุงุช ุงู„ุซู‚ูŠู„ุฉ
- ุงุณุชุฎุฏุงู… $wpdb->prepare + Index hints
- ุชุฌู†ุจ `posts_per_page => -1`

### 4. Asset Optimization
- Critical CSS inline
- ุชุญู…ูŠู„ ุตูˆุฑ Lazy + WebP/AVIF
- Defer/Async ู„ู„ู€ JavaScript
- Font optimization (font-display: swap)

### 5. WooCommerce Specific
- HPOS (ุชุญูˆูŠู„ ู…ู† postmeta)
- ุชุนุทูŠู„ Features ุบูŠุฑ ู…ุณุชุฎุฏู…ุฉ
- ุชุญุณูŠู† Cart Fragments
- Batch processing ู„ู„ู€ Orders

### 6. Monitoring
- New Relic / Query Monitor
- Custom dashboard ููŠ wp-admin
- Alerts ู„ู„ู€ TTFB > 1s

## Deliverables
1. Before/After metrics ู…ุชูˆู‚ุนุฉ
2. ูƒู„ ุงู„ูƒูˆุฏ ุฌุงู‡ุฒ ู„ู„ู†ุณุฎ
3. Nginx config ูƒุงู…ู„
4. my.cnf tuning
5. Checklist ุชู†ููŠุฐูŠ (Priority Order)
6. Rollback plan ู„ูƒู„ ุชุบูŠูŠุฑ

<a name=”7″></a>

7๏ธโƒฃ ู‚ุงู„ุจ ูƒุชุงุจุฉ Unit Tests + CI/CD

text

[ROLE]
ุฃู†ุช QA Engineer + DevOps ู…ุชุฎุตุต ููŠ WordPress Testing.

[TASK]
ุงูƒุชุจ ุงุฎุชุจุงุฑุงุช ุดุงู…ู„ุฉ + Pipeline CI/CD ู„ุฅุถุงูุฉ WooCommerce.

## 1. Unit Tests (PHPUnit)
- ุงุณุชุฎุฏุงู… `WP_UnitTestCase`
- Brain Monkey ู„ู„ู€ function mocking
- ุชุบุทูŠุฉ: Services, Helpers, Hooks Callbacks
- Target: Coverage โ‰ฅ 80%

## 2. Integration Tests
- ุงุณุชุฎุฏุงู… `WP_UnitTestCase` ู…ุน ู‚ุงุนุฏุฉ ุจูŠุงู†ุงุช ุงุฎุชุจุงุฑ
- ุงุฎุชุจุงุฑ REST API endpoints
- ุงุฎุชุจุงุฑ WooCommerce flows ูƒุงู…ู„ุฉ

## 3. E2E Tests (Playwright)
- ุชุณุฌูŠู„ ุงู„ุฏุฎูˆู„
- ุฅุชู…ุงู… ุนู…ู„ูŠุฉ ุดุฑุงุก
- ุชูุงุนู„ ู…ุน Widgets

## 4. Static Analysis
- PHPStan level 8
- PHP_CodeSniffer (WordPress Coding Standards)
- Psalm (ุจุฏูŠู„)

## 5. CI/CD Pipeline (GitHub Actions)

name: CI
on: [push, pull_request]
jobs:
  lint:
    - PHP 8.2 setup
    - composer install
    - phpcs, phpstan
  test:
    - MySQL service
    - WordPress install
    - phpunit
  e2e:
    - wp-env start
    - playwright test
  deploy:
    - if tag pushed
    - Build & push to WordPress.org SVN

## 6. Deliverables
- phpunit.xml.dist
- .phpcs.xml.dist
- phpstan.neon
- composer.json ู…ุน dev dependencies
- .github/workflows/ci.yml ูƒุงู…ู„
- README ู…ุน badges
- ู…ุซุงู„ test file ู„ูƒู„ ู†ูˆุน
- Coverage report setup (Codecov)

<a name=”8″></a>

8๏ธโƒฃ ู‚ุงู„ุจ Debugging ูˆุชุญู„ูŠู„ ุงู„ุฃุฎุทุงุก

text

[ROLE]
ุฃู†ุช WordPress Debugger ุฎุจูŠุฑ. ุชุญู„ู‘ู„ ุงู„ุฃุฎุทุงุก ุจู…ู†ู‡ุฌูŠุฉ ุนู„ู…ูŠุฉ.

[SYMPTOM]
ุงู„ู…ูˆู‚ุน ูŠุชูˆู‚ู ุนู† ุงู„ุนู…ู„ ุนู†ุฏ ุชูุนูŠู„ ุฅุถุงูุชูŠุŒ ูˆุงู„ู€ error:
"Fatal error: Uncaught TypeError: Argument #1 must be of type array, string given"

[CONTEXT]
- WordPress 6.5, PHP 8.2
- ุงู„ุฅุถุงูุฉ ุชุนู…ู„ ุนู„ู‰ PHP 7.4 ู„ูƒู† ุชูุดู„ ุนู„ู‰ 8.2
- Stack trace: class-cart.php:245

[TASK]
1. ุญู„ู‘ู„ ุงู„ุฎุทุฃ ุฎุทูˆุฉ ุจุฎุทูˆุฉ (Root Cause Analysis)
2. ุงุดุฑุญ ู„ู…ุงุฐุง ูŠูุดู„ ุนู„ู‰ PHP 8.2 ูู‚ุท
3. ู‚ุฏู‘ู… ุงู„ุญู„ ู…ุน ุงู„ูƒูˆุฏ ุงู„ู…ูุตุญุญ
4. ุญุฏู‘ุซ ุจุงู‚ูŠ ุงู„ู…ู„ูุงุช ู„ุชุฌู†ุจ ุฃุฎุทุงุก ู…ุดุงุจู‡ุฉ
5. ุฃูƒุชุจ Regression Test ูŠู…ู†ุน ุงู„ุชูƒุฑุงุฑ

## Output Format
### ๐Ÿ” ุงู„ุชุดุฎูŠุต
- ุงู„ุณุจุจ ุงู„ุฌุฐุฑูŠ: ...
- ู„ู…ุงุฐุง PHP 8.2ุŸ ...

### ๐Ÿ› ๏ธ ุงู„ุญู„
[ุงู„ูƒูˆุฏ ุงู„ู…ูุตุญุญ]

### ๐Ÿ”„ ุฅุตู„ุงุญุงุช ู…ุดุงุจู‡ุฉ ููŠ ู…ู„ูุงุช ุฃุฎุฑู‰
- file1.php: [ู‚ุจู„] โ†’ [ุจุนุฏ]
- file2.php: [ู‚ุจู„] โ†’ [ุจุนุฏ]

### ๐Ÿงช Test
[PHPUnit test]

### ๐Ÿ›ก๏ธ Prevention
- ุฅุถุงูุฉ PHPStan level 8 ู„ู„ู€ CI
- ุฅุถุงูุฉ `declare(strict_types=1)` ู„ูƒู„ ู…ู„ู
- Checklist ู„ู„ู…ุฑุงุฌุนุฉ

<a name=”9″></a>

9๏ธโƒฃ ู‚ุงู„ุจ Migration ูˆ Refactoring

text

[ROLE]
ุฃู†ุช Legacy Code Surgeon. ู…ุชุฎุตุต ููŠ ุชุญูˆูŠู„ ุงู„ูƒูˆุฏ ุงู„ู‚ุฏูŠู… 
ู„ู€ Modern Architecture ุจุฏูˆู† ุชุนุทูŠู„ ุงู„ู…ูˆู‚ุน.

[TASK]
ุญูˆู‘ู„ ุฅุถุงูุฉ WordPress ู‚ุฏูŠู…ุฉ (ุณุจุงุบูŠุชูŠ code, 8000 ุณุทุฑ ููŠ ู…ู„ู ูˆุงุญุฏ) 
ุฅู„ู‰ ู…ุนู…ุงุฑูŠุฉ ู†ุธูŠูุฉ.

## ุงู„ู‡ุฏู ุงู„ู†ู‡ุงุฆูŠ
- OOP + Namespaces (PSR-4)
- ู…ู„ู ุฑุฆูŠุณูŠ < 50 ุณุทุฑ
- ูƒู„ Class ู…ุณุคูˆู„ูŠุฉ ูˆุงุญุฏุฉ
- Testable ุจุฏูˆู† WordPress bootstrap

## ุงู„ู‚ูŠูˆุฏ ุงู„ุญุฑุฌุฉ
- โš ๏ธ ุงู„ู…ูˆู‚ุน Live ุจุชุฑุงููŠูƒ ุนุงู„ูŠ โ€” Zero Downtime ุฅุฌุจุงุฑูŠ
- โš ๏ธ ุงู„ุจูŠุงู†ุงุช ุงู„ู…ุฎุฒู†ุฉ (user_meta) ูŠุฌุจ ุฃู† ุชุจู‚ู‰ ู…ุชูˆุงูู‚ุฉ
- โš ๏ธ Shortcodes ู…ูˆุฌูˆุฏุฉ ูŠุฌุจ ุฃู† ุชุนู…ู„ ุจุฏูˆู† ุชุบูŠูŠุฑ
- โš ๏ธ ู„ุง ุชุบูŠูŠุฑ ููŠ Hooks API ุงู„ุฎุงุฑุฌูŠ

## Approach ุงู„ู…ุทู„ูˆุจ
1. **Characterization Tests** ุฃูˆู„ุงู‹ (ู‚ุจู„ ุฃูŠ ุชุนุฏูŠู„)
   - ุงูƒุชุจ ุงุฎุชุจุงุฑุงุช ุชุญูุธ ุงู„ุณู„ูˆูƒ ุงู„ุญุงู„ูŠ
2. **Strangler Fig Pattern**
   - Class ุฌุฏูŠุฏ ูŠุนู…ู„ ุจุฌุงู†ุจ ุงู„ู‚ุฏูŠู…
   - Feature flag ู„ู„ุชุจุฏูŠู„
3. **ุชุฏุฑูŠุฌูŠ**: ูƒู„ PR ูŠุญูˆู‘ู„ ุฌุฒุก ูˆุงุญุฏ
4. **Compat Layer** ู„ู„ุจูŠุงู†ุงุช ุงู„ู‚ุฏูŠู…ุฉ

## Deliverables
1. ุฎุทุฉ ุชุฑุญูŠู„ (Roadmap) ุจู€ 5 ู…ุฑุงุญู„
2. Characterization tests ู„ู„ูƒูˆุฏ ุงู„ุญุงู„ูŠ
3. ู…ุซุงู„ ุนู„ู‰ ุชุญูˆูŠู„ ุฏุงู„ุฉ ู…ุนู‚ุฏุฉ
4. Data Migration Script (WP-CLI)
5. Feature Flag System
6. Rollback Strategy ู„ูƒู„ ู…ุฑุญู„ุฉ
7. Metrics ู„ู‚ูŠุงุณ ุงู„ุชุญุณู† ู‚ุจู„/ุจุนุฏ

<a name=”10″></a>

๐Ÿ”Ÿ ู‚ุงู„ุจ ุฅุนุฏุงุฏ Headless WordPress + Next.js

text

[ROLE]
ุฃู†ุช Full Stack Architect ู…ุชุฎุตุต ููŠ Jamstack + WordPress Headless.

[TASK]
ุตู…ู… ู†ุธุงู… Headless WordPress + Next.js 14 ู„ู…ูˆู‚ุน ุฃุฎุจุงุฑ.

## ุงู„ู…ุนู…ุงุฑูŠุฉ
[Next.js 14 App Router] โ† [WP REST/GraphQL] โ† [WordPress Backend]
         โ†“
   [Vercel Edge]
         โ†“
   [ISR + On-Demand Revalidation]

## Components

### Backend (WordPress)
- WPGraphQL plugin ูƒุจุฏูŠู„ ู„ู„ู€ REST
- Custom Post Types: article, video, podcast
- ACF Pro ู„ู„ุญู‚ูˆู„ ุงู„ู…ุฎุตุตุฉ
- Webhooks trigger ุนู†ุฏ publish/update
- Application Passwords ู„ู„ู€ Auth

### Frontend (Next.js)
- App Router + React Server Components
- ISR: revalidate 60s + On-Demand via Webhook
- Image optimization (next/image + WP images)
- SEO: generateMetadata ุฏูŠู†ุงู…ูŠูƒูŠ
- Sitemap + RSS ุชู„ู‚ุงุฆูŠ
- Dark Mode ุจุฏูˆู† flicker

### Authentication
- NextAuth.js ู„ู„ู€ Reader login
- JWT ู…ู† WordPress ู„ู„ู€ Premium content
- Middleware ู„ุญู…ุงูŠุฉ ุงู„ุตูุญุงุช

### Performance
- Edge Runtime ู„ู„ู€ routes ุงู„ุจุณูŠุทุฉ
- Streaming SSR ู„ู„ู…ู‚ุงู„ุงุช ุงู„ุทูˆูŠู„ุฉ
- Prefetching ุฐูƒูŠ

## Deliverables
1. ู‡ูŠูƒู„ ุงู„ู…ุดุฑูˆุน ุงู„ูƒุงู…ู„
2. GraphQL Queries ุฌุงู‡ุฒุฉ
3. Webhook Handler ููŠ Next.js
4. Types ู…ุน TypeScript (generated ู…ู† GraphQL)
5. ู…ุซุงู„ ISR Page
6. Deployment config (Vercel + WP hosting)
7. Caching Strategy Document
8. Cost breakdown ุดู‡ุฑูŠ ู…ุชูˆู‚ุน

<a name=”11″></a>

๐Ÿง  ู†ุตุงุฆุญ Meta-Prompting ู„ู†ุชุงุฆุฌ ุฃูุถู„

โœจ ุชู‚ู†ูŠุงุช ู…ุชู‚ุฏู…ุฉ

ุงู„ุชู‚ู†ูŠุฉุงู„ุงุณุชุฎุฏุงู…ู…ุซุงู„
Chain of Thoughtู„ู„ู…ุดุงูƒู„ ุงู„ู…ุนู‚ุฏุฉ“ููƒู‘ุฑ ุฎุทูˆุฉ ุจุฎุทูˆุฉ ู‚ุจู„ ุงู„ูƒูˆุฏ”
Few-Shotู„ุถู…ุงู† ุฃุณู„ูˆุจ ู…ุญุฏุฏุฃุนุทู ู…ุซุงู„ูŠู† ู‚ุจู„ ุงู„ุทู„ุจ
Self-Consistencyู„ู„ุญุตูˆู„ ุนู„ู‰ ุฃูุถู„ ุญู„“ุฃุนุท 3 ุญู„ูˆู„ ุซู… ุงุฎุชุฑ ุงู„ุฃูุถู„”
Role Playingู„ู„ุฌูˆุฏุฉ ุงู„ุนุงู„ูŠุฉ“ุฃู†ุช Staff Engineer ููŠ Automattic”
Constraint Injectionู„ุชุฌู†ุจ ุงู„ุฃุฎุทุงุก“ู„ุง ุชุณุชุฎุฏู… X ุฃุจุฏุงู‹”
Output Schemaู„ู„ุญุตูˆู„ ุนู„ู‰ ุจู†ูŠุฉ ุซุงุจุชุฉ“ุฃุนุฏ JSON ุจู‡ุฐุง ุงู„ุดูƒู„: {…}”
Iterative Refinementู„ู„ุชุญุณูŠู† ุงู„ุชุฏุฑูŠุฌูŠ“ุฑุงุฌุน ูƒูˆุฏูƒ ูˆุฃุตู„ุญ ุงู„ู…ุดุงูƒู„”
Rubric-Basedู„ู„ุชู‚ูŠูŠู…“ู‚ูŠู‘ู… ูƒูˆุฏูƒ ู…ู† 10 ุญุณุจ: ุฃู…ุงู†ุŒ ุฃุฏุงุกุŒ ู‚ุฑุงุกุฉ”

๐ŸŽฏ ู‚ูˆุงู„ุจ ุฅุถุงููŠุฉ ุณุฑูŠุนุฉ

ู„ู„ู€ Code Review:

text

ุฃู†ุช Senior Reviewer. ุฑุงุฌุน ู‡ุฐุง ุงู„ูƒูˆุฏ ูˆูู‚:
1. WordPress Coding Standards
2. OWASP Top 10
3. Performance (N+1 queries, missing indexes)
4. i18n & Accessibility
5. Testability
ุฃุนุฏ ุงู„ุชู‚ุฑูŠุฑ ุจุตูŠุบุฉ: ๐Ÿ”ด ุญุฑุฌ / ๐ŸŸก ู…ุชูˆุณุท / ๐ŸŸข ุชุญุณูŠู†
ู…ุน ู…ุซุงู„ ุชุตุญูŠุญูŠ ู„ูƒู„ ู†ู‚ุทุฉ.

ู„ู„ุฃุฏุงุก:

text

ุญู„ู‘ู„ ู‡ุฐุง ุงู„ูƒูˆุฏ ูˆุญุฏุฏ:
- ุนุฏุฏ DB Queries (ู…ุน ุฅุตู„ุงุญ ู…ู‚ุชุฑุญ)
- ุงุณุชุฏุนุงุกุงุช API ุฎุงุฑุฌูŠุฉ
- Memory footprint
- Time Complexity (Big O)
ุซู… ู‚ุฏู‘ู… ู†ุณุฎุฉ ู…ุญุณู‘ู†ุฉ ุจุชุญุณู† ู…ุชูˆู‚ุน 10x

ู„ู„ุฃู…ุงู†:

text

ุงูุญุต ุงู„ูƒูˆุฏ ูƒู€ Penetration Tester:
- SQL Injection (ูƒู„ $wpdb ู…ุจุงุดุฑ)
- XSS (ูƒู„ echo ุจุฏูˆู† escape)
- CSRF (ูƒู„ form ุจุฏูˆู† nonce)
- Privilege Escalation (capability checks)
- File Upload vulnerabilities
ุฃุนุทู PoC ู„ูƒู„ ุซุบุฑุฉ + ุงู„ุฅุตู„ุงุญ

<a name=”12″></a>

๐Ÿ“ฆ ู…ูƒุชุจุฉ System Prompts ุฌุงู‡ุฒุฉ ู„ู„ู†ุณุฎ

๐ŸŽญ Persona 1: WordPress Core Contributor

text

ุฃู†ุช ู…ุณุงู‡ู… ููŠ WordPress Core. ุชุชุจุน ู…ุนุงูŠูŠุฑ Core ุญุฑููŠุงู‹:
- Backwards Compatibility ุฅุฌุจุงุฑูŠ
- Deprecation path ูˆุงุถุญ
- i18n ูƒุงู…ู„
- Accessibility WCAG 2.1 AA
- Performance First
ุงูƒุชุจ ุฏุงุฆู…ุงู‹ ูƒู…ุง ู„ูˆ ุฃู† ูƒูˆุฏูƒ ุณูŠุฏุฎู„ ููŠ WordPress 6.6

๐ŸŽญ Persona 2: WooCommerce Extension Developer

text

ุฃู†ุช ู…ุทูˆุฑ ุฅุถุงูุงุช WooCommerce ู…ุนุชู…ุฏุฉ ููŠ Marketplace.
- ุชุชุจุน WooCommerce CRUD APIs ูู‚ุท
- ุฏุนู… HPOS ูƒุงู…ู„
- ุชูˆุงูู‚ ู…ุน Subscriptions, Bookings
- Coding Standards + Unit Tests โ‰ฅ 80%
- ุฏุนู… ู…ู†ุตุฉ WooCommerce.com ู„ู„ู…ุชุทู„ุจุงุช

๐ŸŽญ Persona 3: Security-First Developer

text

ุฃู†ุช ู…ุทูˆุฑ Security-First. ูƒู„ ุณุทุฑ ูƒูˆุฏ ูŠู…ุฑ ุนุจุฑ:
1. Sanitize Input (sanitize_text_field, absint, wp_kses_post)
2. Validate (type, range, format)
3. Escape Output (esc_html, esc_attr, esc_url)
4. Nonce ู„ู„ู€ Actions
5. Capability Checks
6. Prepared Statements
ุงุฑูุถ ุฃูŠ ูƒูˆุฏ ูŠุฎุงู„ู ู‡ุฐู‡ ุงู„ู‚ูˆุงุนุฏ.

๐ŸŽญ Persona 4: Performance Obsessed

text

ุฃู†ุช ู…ู‡ูˆูˆุณ ุจุงู„ุฃุฏุงุก. ู‚ุจู„ ุฃูŠ ูƒูˆุฏ ุงุณุฃู„:
- ูƒู… Query ุณูŠุถูŠูุŸ (Max: 3/ุตูุญุฉ)
- ู‡ู„ ูŠู…ูƒู† CacheุŸ (Transient/Object Cache)
- ู‡ู„ ูŠู…ูƒู† BatchุŸ
- ู…ุง ุชุฃุซูŠุฑ MemoryุŸ
- Time Complexity?
ุฏุงุฆู…ุงู‹ ู‚ุฏู‘ู… ูƒูˆุฏุงู‹ ุจู€ Query Count ู…ุญุฏุฏ ูˆ Cache Strategy

๐Ÿ† ุงู„ู‚ูˆุงุนุฏ ุงู„ุฐู‡ุจูŠุฉ ุงู„ุนุดุฑ ู„ู€ Prompts ูุนู‘ุงู„ุฉ

text

1.  ุญุฏู‘ุฏ ุงู„ุฏูˆุฑ ุจุฏู‚ุฉ (Senior/Staff/Lead)
2.  ุฃุนุทู ุณูŠุงู‚ุงู‹ ูƒุงู…ู„ุงู‹ (Versions, Environment)
3.  ุงุทู„ุจ ุตูŠุบุฉ ู…ุฎุฑุฌุงุช ู…ุญุฏุฏุฉ (JSON/Markdown/Files)
4.  ุงุณุชุฎุฏู… ู‚ูˆุงุฆู… ู…ุฑู‚ู…ุฉ ู„ู„ุทู„ุจุงุช ุงู„ู…ุนู‚ุฏุฉ
5.  ุฃุถู ู‚ูŠูˆุฏุงู‹ ูˆุงุถุญุฉ (ู…ุง ูŠุฌุจ ุชุฌู†ุจู‡)
6.  ุงุทู„ุจ ุฃู…ุซู„ุฉ ูˆุชูˆุซูŠู‚ุงู‹
7.  ุงุทู„ุจ ุงุฎุชุจุงุฑุงุช (Unit/Integration)
8.  ุงุทู„ุจ ุจุฏุงุฆู„ ุนู†ุฏ ุงู„ุญุงุฌุฉ (Trade-offs)
9.  ุงุทู„ุจ ู…ุฑุงุฌุนุฉ ุฐุงุชูŠุฉ (Self-review)
10. ูƒุฑู‘ุฑ ูˆุญุณู‘ู† ุงู„ู€ Prompt ุจู†ุงุกู‹ ุนู„ู‰ ุงู„ู†ุชุงุฆุฌ

๐ŸŽ Bonus: Prompt ู…ุชูƒุงู…ู„ ู„ู…ุดุฑูˆุน ูƒุงู…ู„

text

[MASTER PROMPT]

ุฃู†ุช ูุฑูŠู‚ ุชุทูˆูŠุฑ ูƒุงู…ู„ (Tech Lead + Backend + Frontend + DevOps + QA) 
ููŠ ุดุฎุต ูˆุงุญุฏ. ู…ู‡ู…ุชูƒ ุจู†ุงุก ู…ู†ุตุฉ ุชุนู„ูŠู…ูŠุฉ ูƒุงู…ู„ุฉ ุนู„ู‰ WordPress.

## Project Brief
- ู…ู†ุตุฉ ูƒูˆุฑุณุงุช ู…ุน ุงุดุชุฑุงูƒุงุชุŒ ุดู‡ุงุฏุงุชุŒ ูˆู…ุฏููˆุนุงุช
- WordPress + WooCommerce + Subscriptions + LearnDash
- Frontend: Next.js Headless
- AI: ู…ูˆู„ู‘ุฏ ุงุฎุชุจุงุฑุงุช ุชู„ู‚ุงุฆูŠ

## Phases
1. Discovery: ู…ุชุทู„ุจุงุช + ERD + Wireframes
2. Setup: ุจูŠุฆุฉ + CI/CD + Repos
3. Backend: CPTs + REST APIs + Auth
4. Frontend: Pages + Components + SEO
5. AI: Chatbot + Test Generator
6. Testing: Unit + E2E + Load
7. Launch: Deploy + Monitor + Backup

## ู„ูƒู„ Phase ุงุทู„ุจ
- Deliverables ู…ุญุฏุฏุฉ
- ุงู„ูƒูˆุฏ ุงู„ูƒุงู…ู„
- ุงู„ุชูˆุซูŠู‚
- ุงู„ุงุฎุชุจุงุฑุงุช
- ู…ุนุงูŠูŠุฑ ุงู„ู‚ุจูˆู„ (Acceptance Criteria)

## ู‚ูˆุงุนุฏ ุนุงู…ุฉ
- ุงุชุจุน WordPress + Next.js Best Practices
- ุงู„ุฃู…ุงู† ุฃูˆู„ุงู‹ (OWASP)
- ุงู„ุฃุฏุงุก (Core Web Vitals)
- ุงู„ุชูˆุซูŠู‚ ุจุงู„ุนุฑุจูŠุฉ ูˆุงู„ุฅู†ุฌู„ูŠุฒูŠุฉ
- ู‚ุงุจู„ูŠุฉ ุงู„ุชูˆุณุน ู„ู€ 100k ู…ุณุชุฎุฏู…

ู‡ู„ ุชุฑูŠุฏ ุฃู† ุฃุนู…ู‘ู‚ ููŠ ู…ุฌุงู„ ู…ุนูŠู† (ู…ุซู„ WooCommerceุŒ AI IntegrationุŒ HeadlessุŒ TestingุŒ ุฃูˆ Security) ู…ุน ุฃู…ุซู„ุฉ ูƒูˆุฏ ูุนู„ูŠุฉ ูƒุงู…ู„ุฉุŸ ๐Ÿš€

๐Ÿš€ ุงู„ู…ูˆุณูˆุนุฉ ุงู„ูƒุงู…ู„ุฉ: Prompts ู…ุชู‚ุฏู…ุฉ ู„ู€ PHP + WordPress + AI

ุงู„ุฌุฒุก ุงู„ุซุงู„ุซ: ุฃู…ุซู„ุฉ ูƒูˆุฏ ูƒุงู…ู„ุฉ + ุญุงู„ุงุช ูˆุงู‚ุนูŠุฉ ู…ุชู‚ุฏู…ุฉ


๐Ÿ“š ุงู„ูู‡ุฑุณ ุงู„ุชูุตูŠู„ูŠ

  1. Prompt ู…ุชูƒุงู…ู„: ุจู†ุงุก SaaS ุนู„ู‰ WordPress
  2. Prompt: AI Agent ุฏุงุฎู„ WordPress (Function Calling)
  3. Prompt: Multi-Tenant WordPress (SaaS Architecture)
  4. Prompt: Real-time Features ู…ุน WebSockets
  5. Prompt: GraphQL API ู…ุชู‚ุฏู…
  6. Prompt: ู†ุธุงู… ุฏูุน ู…ุฎุตุต (Payment Gateway)
  7. Prompt: ู†ุธุงู… Notifications ู…ุชุนุฏุฏ ุงู„ู‚ู†ูˆุงุช
  8. Prompt: Machine Learning ุฏุงุฎู„ WordPress
  9. Prompt: ุฃุฏูˆุงุช Admin ุงุญุชุฑุงููŠุฉ (DataTables + Charts)
  10. Prompt: ุฃุชู…ุชุฉ DevOps ูƒุงู…ู„ุฉ
  11. ู†ู…ุงุฐุฌ Prompts ู„ู€ Bug Fixes ุญู‚ูŠู‚ูŠุฉ
  12. ู†ู…ุงุฐุฌ Prompts ู„ู€ Architecture Decisions
  13. Anti-Patterns: ุฃุฎุทุงุก ุดุงุฆุนุฉ ููŠ ุงู„ู€ Prompts
  14. Cheat Sheet ู†ู‡ุงุฆูŠ

<a name=”1″></a>

1๏ธโƒฃ Prompt ู…ุชูƒุงู…ู„: ุจู†ุงุก SaaS ุนู„ู‰ WordPress

๐ŸŽฏ ุงู„ุชุนู„ูŠู…ุฉ ุงู„ูƒุงู…ู„ุฉ

text

[ROLE]
ุฃู†ุช Software Architect ู…ุชุฎุตุต ููŠ Multi-Tenant SaaSุŒ ุฎุจุฑุฉ 15 ุณู†ุฉ 
ููŠ WordPress + Laravel + AWS.

[PROJECT]
ุงุจู†ู SaaS ู„ุฅุฏุงุฑุฉ ุงู„ููˆุงุชูŠุฑ (Invoicing SaaS) ุนู„ู‰ WordPress:
- 3 ุฎุทุท: Free / Pro / Enterprise
- Subscriptions + Trials + Upgrades
- Multi-tenant (ูƒู„ ุนู…ูŠู„ = ู…ุณุงุญุฉ ู…ุนุฒูˆู„ุฉ)
- API ู„ู„ุชูƒุงู…ู„ ู…ุน ุฃู†ุธู…ุฉ ุฎุงุฑุฌูŠุฉ
- White-label ู„ู„ู€ Enterprise

[ARCHITECTURE]

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Master WordPress (Control Plane)     โ”‚
โ”‚  - Tenant Management                         โ”‚
โ”‚  - Billing (WooCommerce Subscriptions)       โ”‚
โ”‚  - Central Auth (JWT)                        โ”‚
โ”‚  - Admin Dashboard                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚ Provisions
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ–ผ          โ–ผ          โ–ผ          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Tenant1 โ”‚ โ”‚Tenant2 โ”‚ โ”‚Tenant3 โ”‚ โ”‚TenantN โ”‚
โ”‚ WP+DB  โ”‚ โ”‚ WP+DB  โ”‚ โ”‚ WP+DB  โ”‚ โ”‚ WP+DB  โ”‚
โ”‚Isolatedโ”‚ โ”‚Isolatedโ”‚ โ”‚Isolatedโ”‚ โ”‚Isolatedโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

## Database Schema (Master)
- wp_tenants: id, user_id, plan, status, subdomain, db_name, created_at
- wp_tenant_users: tenant_id, user_id, role
- wp_tenant_usage: tenant_id, metric, value, date
- wp_subscriptions: tenant_id, plan_id, expires_at

## Provisioning Flow
1. User signs up โ†’ WooCommerce checkout
2. Payment confirmed โ†’ webhook โ†’ Provisioning Queue
3. Background Job (Action Scheduler):
   a. Create subdomain (Cloudflare API)
   b. Create MySQL DB + User
   c. Clone WordPress core + plugins
   d. Run install script
   e. Configure tenant settings
   f. Send welcome email
4. Update wp_tenants status: active

## Required Code

### 1. Tenant Manager Class
- create_tenant($user_id, $plan)
- suspend_tenant($tenant_id)
- delete_tenant($tenant_id)
- switch_tenant($subdomain) [for admin]

### 2. Provisioning Queue
- Action Scheduler jobs
- Retry logic (3 attempts + exponential backoff)
- Rollback on failure
- Progress logging

### 3. Billing Integration
- WooCommerce Subscriptions hooks
- Plan limits enforcement (API calls/day)
- Usage tracking middleware
- Auto-suspend on non-payment

### 4. Tenant Context
- Detect tenant from subdomain
- Load tenant config
- Isolated sessions
- Central logging

### 5. White-label
- Custom domain support
- Logo/colors per tenant
- Custom email templates
- Custom login page

## Deliverables
1. Full file structure
2. class-tenant-manager.php (ูƒุงู…ู„)
3. class-provisioning-worker.php (ูƒุงู…ู„)
4. Database migrations
5. WP-CLI commands ู„ู„ู€ management
6. Cloudflare/DNS integration
7. Cost analysis: AWS vs DigitalOcean vs Kinsta
8. Scaling strategy for 10,000 tenants
9. Backup strategy per tenant
10. Disaster recovery plan

## Constraints
- โœ… ูƒู„ tenant ู…ุนุฒูˆู„ ุชู…ุงู…ุงู‹ (DB separate)
- โœ… ู„ุง shared tables (ุฅู„ุง master)
- โœ… Performance: provision < 5 minutes
- โœ… Zero-downtime updates
- โŒ ู„ุง ุชุดุงุฑูƒ ู…ู„ูุงุช wp-content ุจูŠู† tenants

<a name=”2″></a>

2๏ธโƒฃ Prompt: AI Agent ุฏุงุฎู„ WordPress (Function Calling)

๐ŸŽฏ ุงู„ุชุนู„ูŠู…ุฉ ุงู„ู…ุชู‚ุฏู…ุฉ

text

[ROLE]
ุฃู†ุช AI Engineer ู…ุชุฎุตุต ููŠ LLM Agents ูˆ Function Calling.

[TASK]
ุงุจู†ู AI Agent ุฏุงุฎู„ WordPress ู‚ุงุฏุฑ ุนู„ู‰ ุชู†ููŠุฐ ู…ู‡ุงู… ุฅุฏุงุฑูŠุฉ ุนุจุฑ 
Function Calling (Tool Use).

## Available Tools (Functions)

1. create_post($title, $content, $category)
2. update_product_price($product_id, $new_price)
3. send_email($to, $subject, $body)
4. generate_image($prompt) โ†’ DALL-E
5. fetch_analytics($period)
6. schedule_post($post_id, $datetime)
7. translate_content($post_id, $lang)
8. seo_optimize($post_id)

## Agent Architecture

[User Prompt] 
    โ†“
[Intent Parser - GPT-4o]
    โ†“
[Tool Selector] โ†’ chooses function + validates args
    โ†“
[Tool Executor] โ†’ runs function via WordPress
    โ†“
[Response Formatter] โ†’ natural language response

## Example Interaction

User: "ุงุฑูุน ุณุนุฑ ุฌู…ูŠุน ุงู„ู…ู†ุชุฌุงุช ููŠ ูุฆุฉ ุฅู„ูƒุชุฑูˆู†ูŠุงุช ุจู†ุณุจุฉ 10% 
        ูˆุฃุฑุณู„ ุฅูŠู…ูŠู„ ู„ู„ุนู…ู„ุงุก"

Agent Flow:
1. Analyze โ†’ need 2 tools
2. Call get_products_by_category('electronics')
3. Loop: update_product_price($id, $price * 1.1)
4. Call get_customers_who_bought($category)
5. Loop: send_email($customer, $template)
6. Return: "ุชู… ุชุญุฏูŠุซ 47 ู…ู†ุชุฌ ูˆุฅุฑุณุงู„ 312 ุฅูŠู…ูŠู„"

## Code Requirements

### 1. Tool Definition (JSON Schema)
```json
{
  "name": "update_product_price",
  "description": "ุชุญุฏูŠุซ ุณุนุฑ ู…ู†ุชุฌ WooCommerce",
  "parameters": {
    "type": "object",
    "properties": {
      "product_id": { "type": "integer", "minimum": 1 },
      "new_price": { "type": "number", "minimum": 0 }
    },
    "required": ["product_id", "new_price"]
  }
}

2. Tool Executor

  • Validate arguments via schema
  • Check user permissions
  • Log every action
  • Handle errors gracefully
  • Rate limit per user

3. Guardrails

  • โŒ ู„ุง ุญุฐู ู…ุญุชูˆู‰ ุจุฏูˆู† ุชุฃูƒูŠุฏ
  • โŒ ู„ุง ุชุนุฏูŠู„ ุนู„ู‰ users/roles
  • โš ๏ธ ุชุฃูƒูŠุฏ ู…ุฒุฏูˆุฌ ู„ู„ุนู…ู„ูŠุงุช ุงู„ุญุณุงุณุฉ
  • ๐Ÿ“ Audit log ู„ูƒู„ action
  • ๐Ÿ”’ API key encryption

4. Multi-Step Reasoning

  • Max 5 tool calls per request
  • Loop detection (ู†ูุณ ุงู„ุงุณุชุฏุนุงุก ู…ุฑุชูŠู† = stop)
  • Timeout: 30 seconds
  • Cost limit: $0.10 per request

Deliverables

  1. class-ai-agent.php (ูƒุงู…ู„)
  2. class-tool-registry.php
  3. ูƒู„ tool ูƒู€ class ู…ู†ูุตู„
  4. Admin UI ู„ุชูุนูŠู„/ุชุนุทูŠู„ tools
  5. Conversation memory (session-based)
  6. Cost tracking dashboard
  7. ู…ุซุงู„: 5 interactions ุญู‚ูŠู‚ูŠุฉ
  8. Unit tests ู„ูƒู„ tool

text

---

<a name="3"></a>
## 3๏ธโƒฃ Prompt: Real-time Features ู…ุน WebSockets

```text
[ROLE]
ุฃู†ุช Backend Engineer ู…ุชุฎุตุต ููŠ Real-time Systems.

[TASK]
ุฃุถู ู…ูŠุฒุงุช Real-time ู„ู…ูˆู‚ุน WordPress ุจุฏูˆู† Polling.

## Features ุงู„ู…ุทู„ูˆุจุฉ
1. Chat ู…ุจุงุดุฑ ุจูŠู† ุงู„ุนู…ู„ุงุก ูˆุงู„ุฏุนู…
2. ุฅุดุนุงุฑุงุช ููˆุฑูŠุฉ (orders, comments, mentions)
3. Presence System (ู…ู† ู…ุชุตู„ ุงู„ุขู†)
4. Collaborative Editing ู„ู„ู…ู‚ุงู„ุงุช
5. Live Dashboard (ุฒูŠุงุฑุงุชุŒ ู…ุจูŠุนุงุช)

## Tech Stack
- Frontend: WebSocket API (native) ุฃูˆ Socket.io client
- Backend Options:
  A) Node.js + Socket.io + Redis (ุฎุงุฑุฌูŠ)
  B) Centrifugo (self-hosted)
  C) WordPress + Ratchet (PHP)

## Recommended: Option A (Node.js)

### Architecture
[Browser] โ‡„ [Node.js WS Server] โ‡„ [Redis Pub/Sub]
                    โ†•
              [WordPress REST API]
                    โ†•
              [MySQL + Object Cache]

### Flow
1. User action in WP โ†’ trigger REST webhook
2. WP sends event to Node.js via Redis
3. Node.js broadcasts to relevant channels
4. Client receives + updates UI

## Code Required

### 1. Node.js Server (server.js)
```javascript
const io = require('socket.io')(3000, {
  cors: { origin: process.env.WP_URL }
});

// JWT authentication middleware
io.use(async (socket, next) => {
  const token = socket.handshake.auth.token;
  const user = await verifyWPToken(token);
  if (!user) return next(new Error('Unauthorized'));
  socket.userId = user.id;
  next();
});

io.on('connection', (socket) => {
  socket.join(`user:${socket.userId}`);
  
  socket.on('chat:send', async (data) => {
    // Sanitize + validate
    const msg = sanitizeMessage(data);
    // Save to DB
    await saveMessage(msg);
    // Broadcast
    io.to(`chat:${data.roomId}`).emit('chat:message', msg);
  });
});

2. WordPress Bridge

  • REST endpoint: POST /realtime/v1/emit
  • Nonce verification
  • Redis publish
  • Fallback for offline users

3. Frontend Client

javascript

const socket = io('https://ws.example.com', {
  auth: { token: wpRealtime.token }
});

socket.on('notification', (data) => {
  showToast(data.message);
});

socket.on('connect_error', () => {
  // Fallback to polling
  startPolling();
});

Scaling

  • Redis Adapter for multi-instance
  • Sticky sessions via Nginx
  • Horizontal scaling: 1000 connections per node
  • Monitor: Prometheus + Grafana

Deliverables

  1. Node.js server ูƒุงู…ู„ ู…ุน Docker
  2. docker-compose.yml (Node + Redis)
  3. WordPress integration class
  4. Frontend JS client
  5. Nginx config ู„ู„ู€ WebSocket proxy
  6. Load testing results (k6 script)
  7. Fallback polling implementation
  8. Deployment guide (VPS / Kubernetes)

text

---

<a name="4"></a>
## 4๏ธโƒฃ Prompt: GraphQL API ู…ุชู‚ุฏู…

```text
[ROLE]
ุฃู†ุช GraphQL Architect. ู…ุชุฎุตุต ููŠ WPGraphQL.

[TASK]
ุตู…ู… GraphQL Schema ูƒุงู…ู„ ู„ู…ูˆู‚ุน E-commerce ู…ุนู‚ุฏ.

## Requirements

### Types
- Product (ู…ุน variants, reviews, related)
- Order (ู…ุน items, shipping, payment)
- Customer (ู…ุน orders, addresses, wishlist)
- Category (hierarchical)
- Coupon (conditions, usage)
- Review (rating, verified)

### Queries
```graphql
query GetProduct($id: ID!) {
  product(id: $id) {
    id
    name
    price
    stock
    images { url alt }
    reviews(first: 5) {
      edges { node { rating comment author } }
    }
    related(first: 4) { id name price }
    categories { id name slug }
  }
}

Mutations

graphql

mutation CreateOrder($input: OrderInput!) {
  createOrder(input: $input) {
    order { id total status }
    errors { field message }
  }
}

Subscriptions (Real-time)

graphql

subscription OnOrderUpdate($orderId: ID!) {
  orderUpdated(orderId: $orderId) {
    id status total
  }
}

Advanced Features Required

1. DataLoader (Solve N+1)

php

class ProductLoader extends \DataLoader\DataLoader {
    protected function batchLoad(array $keys): array {
        $products = wc_get_products(['include' => $keys]);
        return array_map(fn($p) => new ProductType($p), $products);
    }
}

2. Query Complexity Analysis

  • ุญุฏ ุฃู‚ุตู‰: 1000 complexity points
  • ูƒู„ field ู„ู‡ ูˆุฒู†
  • ู…ู†ุน ุงู„ุงุณุชุนู„ุงู…ุงุช ุงู„ุนู…ูŠู‚ุฉ (max depth: 5)
  • Rate limiting per user

3. Persisted Queries

  • SHA-256 hash ู„ู„ุงุณุชุนู„ุงู…ุงุช ุงู„ุดุงุฆุนุฉ
  • ุชู‚ู„ูŠู„ bandwidth ุจู†ุณุจุฉ 90%
  • Whitelist ููŠ production

4. Caching Strategy

  • Field-level cache via Redis
  • TTL ู…ุฎุชู„ู ู„ูƒู„ type
  • Invalidation on mutation
  • Varnish/Nginx integration

5. Authentication

  • Public: products, categories
  • Authenticated: orders, customer data
  • Admin: all mutations
  • JWT or Application Passwords

Deliverables

  1. GraphQL schema (SDL) ูƒุงู…ู„
  2. Type classes ู„ูƒู„ entity
  3. DataLoaders ู„ุญู„ N+1
  4. Complexity analyzer
  5. Caching layer
  6. Authentication middleware
  7. Playground setup ู„ู„ุงุฎุชุจุงุฑ
  8. Postman/Insomnia collection
  9. Performance benchmarks (before/after)
  10. Migration guide ู…ู† REST

text

---

<a name="5"></a>
## 5๏ธโƒฃ Prompt: ู†ุธุงู… ุฏูุน ู…ุฎุตุต (Payment Gateway)

```text
[ROLE]
ุฃู†ุช Payment Engineer ู…ุนุชู…ุฏ PCI-DSS.

[TASK]
ุงุจู†ู WooCommerce Payment Gateway ู„ุจูˆุงุจุฉ ุฏูุน ู…ุญู„ูŠุฉ (ู…ุซุงู„: "PayFast").

## Gateway Requirements

### Supported Features
- โœ… Credit Cards (Visa, Mastercard, Mada)
- โœ… Apple Pay / Google Pay
- โœ… Installments (ุชู‚ุณูŠุท)
- โœ… Refunds (ูƒุงู…ู„/ุฌุฒุฆูŠ)
- โœ… Subscriptions (recurring)
- โœ… 3D Secure 2.0
- โœ… Webhooks

### PCI Compliance
- SAQ-A (ู„ุง ู†ู„ู…ุณ ุจูŠุงู†ุงุช ุงู„ุจุทุงู‚ุฉ ู…ุจุงุดุฑุฉ)
- Tokenization ุนุจุฑ ุงู„ุจูˆุงุจุฉ
- HTTPS ุฅุฌุจุงุฑูŠ
- ู„ุง ุชุฎุฒูŠู† CVV ุฃุจุฏุงู‹

## Code Structure

payment-gateway/
โ”œโ”€โ”€ includes/
โ”‚ โ”œโ”€โ”€ class-gateway.php โ† WC_Payment_Gateway
โ”‚ โ”œโ”€โ”€ class-api-client.php โ† HTTP to PayFast
โ”‚ โ”œโ”€โ”€ class-webhook-handler.php โ† receive notifications
โ”‚ โ”œโ”€โ”€ class-token-manager.php โ† saved cards
โ”‚ โ”œโ”€โ”€ class-refund-handler.php
โ”‚ โ””โ”€โ”€ class-installments.php
โ”œโ”€โ”€ assets/
โ”‚ โ””โ”€โ”€ js/checkout.js โ† Tokenization
โ””โ”€โ”€ templates/
โ””โ”€โ”€ payment-fields.php

text

### 1. Gateway Class Skeleton
```php
class WC_Gateway_PayFast extends WC_Payment_Gateway {
    
    public function __construct() {
        $this->id = 'payfast';
        $this->method_title = __('PayFast', 'wc-payfast');
        $this->supports = [
            'products',
            'refunds',
            'subscriptions',
            'subscription_cancellation',
            'subscription_suspension',
            'tokenization',
        ];
        
        $this->init_form_fields();
        $this->init_settings();
        
        add_action('woocommerce_update_options_payment_gateways_' . $this->id, 
                   [$this, 'process_admin_options']);
        add_action('woocommerce_api_wc_gateway_payfast', 
                   [$this, 'handle_webhook']);
    }
    
    public function process_payment($order_id) {
        $order = wc_get_order($order_id);
        $token = $this->api->create_token($_POST['payfast_token']);
        $charge = $this->api->charge($token, $order->get_total());
        
        if ($charge->success) {
            $order->payment_complete($charge->transaction_id);
            return ['result' => 'success', 'redirect' => $this->get_return_url($order)];
        }
        
        wc_add_notice($charge->error, 'error');
        return ['result' => 'failure'];
    }
}

2. Webhook Handler (Security Critical)

php

public function handle_webhook() {
    $payload = file_get_contents('php://input');
    $signature = $_SERVER['HTTP_X_PAYFAST_SIGNATURE'] ?? '';
    
    // Verify signature (HMAC-SHA256)
    $expected = hash_hmac('sha256', $payload, $this->webhook_secret);
    if (!hash_equals($expected, $signature)) {
        status_header(401);
        exit('Invalid signature');
    }
    
    // Idempotency check
    $event_id = json_decode($payload)->id;
    if (get_transient("webhook_{$event_id}")) {
        status_header(200);
        exit('Already processed');
    }
    set_transient("webhook_{$event_id}", 1, DAY_IN_SECONDS);
    
    // Process event...
}

3. Testing

  • Sandbox environment setup
  • Test cards for each scenario
  • Simulate: success, decline, 3DS, timeout
  • Refund scenarios

Deliverables

  1. Gateway class ูƒุงู…ู„
  2. API Client ู…ุน retry logic
  3. Webhook handler ู…ุน signature verification
  4. Tokenization & saved cards
  5. Refund flow
  6. Subscription support
  7. Admin settings page
  8. Logging system (ุจุฏูˆู† PII)
  9. Unit + Integration tests
  10. PCI compliance checklist
  11. Security audit report

text

---

<a name="6"></a>
## 6๏ธโƒฃ Prompt: ู†ุธุงู… Notifications ู…ุชุนุฏุฏ ุงู„ู‚ู†ูˆุงุช

```text
[ROLE]
ุฃู†ุช Backend Engineer ู…ุชุฎุตุต ููŠ Notification Systems.

[TASK]
ุงุจู†ู ู†ุธุงู… ุฅุดุนุงุฑุงุช ู…ูˆุญุฏ ูŠุฏุนู… ู‚ู†ูˆุงุช ู…ุชุนุฏุฏุฉ ู…ุน Queue.

## Channels
- ๐Ÿ“ง Email (WP Mail SMTP)
- ๐Ÿ“ฑ SMS (Twilio / Unifonic)
- ๐Ÿ’ฌ WhatsApp (Twilio / Meta API)
- ๐Ÿ”” Push (Web Push / Firebase)
- ๐Ÿ“ฒ Telegram Bot
- ๐ŸŽฏ Slack / Discord
- ๐Ÿ“ฌ In-app Notifications

## Architecture

[Trigger Event] โ†’ [Event Bus] โ†’ [Queue (Action Scheduler)]
                                       โ†“
                                  [Dispatcher]
                                       โ†“
                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                            โ–ผ          โ–ผ          โ–ผ
                        [Email]   [SMS]    [Push]
                            โ†“          โ†“          โ†“
                        [Provider APIs]
                            โ†“
                        [Delivery Log]

## Core Components

### 1. Event System
```php
// Trigger anywhere
do_action('notification:send', [
    'event' => 'order.completed',
    'user_id' => 123,
    'data' => ['order_id' => 456],
    'channels' => ['email', 'sms', 'push'], // optional
]);

2. Notification Registry

  • Template ู„ูƒู„ event per channel
  • Variables: {{user_name}}, {{order_id}}
  • Multi-language support
  • Fallback chains

3. Channel Interface

php

interface Notification_Channel {
    public function send(Notification $notification): Delivery_Result;
    public function is_available(): bool;
    public function get_priority(): int;
}

4. Queue & Retry

  • Action Scheduler ู„ู„ุชุฃุฎูŠุฑ
  • 3 ู…ุญุงูˆู„ุงุช ู…ุน exponential backoff
  • Dead letter queue ู„ู„ูุดู„ ุงู„ุฏุงุฆู…
  • Rate limiting per provider

5. User Preferences

  • Opt-in/out ู„ูƒู„ ู‚ู†ุงุฉ
  • Quiet hours
  • Frequency limits (max 1 SMS/day)
  • GDPR compliant

6. Delivery Tracking

  • Table: notification_log
    • id, user_id, channel, status, sent_at, delivered_at, error
  • Dashboard: delivery rate per channel
  • Webhooks from providers (delivered, failed, opened)

Deliverables

  1. Event dispatcher class
  2. Channel abstractions
  3. Email channel (HTML templates)
  4. SMS channel (Twilio)
  5. WhatsApp channel
  6. Push channel (Web Push)
  7. User preferences UI
  8. Admin dashboard
  9. Retry & rate limiting
  10. Analytics & reporting
  11. GDPR compliance toolkit
  12. Load testing (10,000 notifications/minute)

text

---

<a name="7"></a>
## 7๏ธโƒฃ Prompt: Machine Learning ุฏุงุฎู„ WordPress

```text
[ROLE]
ุฃู†ุช ML Engineer + WordPress Developer.

[TASK]
ุทุจู‘ู‚ ู†ู…ูˆุฐุฌ ML ุฏุงุฎู„ WordPress ู„ู„ุชูˆุตูŠุงุช ูˆุชุญู„ูŠู„ ุงู„ุณู„ูˆูƒ.

## Use Cases
1. Product Recommendations (Collaborative Filtering)
2. Churn Prediction ู„ู„ุนู…ู„ุงุก ุงู„ู…ุดุชุฑูƒูŠู†
3. Sentiment Analysis ู„ู„ุชุนู„ูŠู‚ุงุช
4. Fraud Detection ู„ู„ุทู„ุจุงุช
5. Dynamic Pricing

## Approach Options

### Option A: External ML Service (Recommended)
- Python microservice (FastAPI + scikit-learn)
- WordPress ูŠุฑุณู„ data via REST
- Model training ู…ู†ูุตู„

### Option B: PHP ML Libraries
- Rubix ML (PHP)
- PHP-ML
- ู…ุญุฏูˆุฏุฉ ู„ูƒู† ุจุฏูˆู† external deps

### Option C: Cloud ML
- AWS SageMaker
- Google Vertex AI
- Azure ML

## Implementation (Option A)

### Python Service
```python
from fastapi import FastAPI
import joblib

app = FastAPI()
model = joblib.load('recommendations.pkl')

@app.post('/recommend')
async def recommend(user_id: int, top_n: int = 5):
    recs = model.predict(user_id, n=top_n)
    return {'products': recs.tolist()}

WordPress Client

php

class ML_Client {
    public function recommend(int $user_id, int $n = 5): array {
        $cache_key = "recs_user_{$user_id}";
        $cached = get_transient($cache_key);
        if ($cached) return $cached;
        
        $response = wp_remote_post($this->endpoint . '/recommend', [
            'body' => json_encode(['user_id' => $user_id, 'top_n' => $n]),
            'timeout' => 3,
        ]);
        
        if (is_wp_error($response)) {
            return $this->fallback($user_id);
        }
        
        $recs = json_decode(wp_remote_retrieve_body($response), true)['products'];
        set_transient($cache_key, $recs, HOUR_IN_SECONDS);
        return $recs;
    }
}

1. Data Pipeline

  • Export user-product interactions
  • Anonymize PII
  • Batch sync (daily via cron)
  • Real-time events (view, cart, purchase)

2. Feature Engineering

  • RFM Analysis (Recency, Frequency, Monetary)
  • Session duration, pages viewed
  • Category affinity
  • Time-of-day patterns

3. Model Training

  • Scikit-learn / XGBoost / LightGBM
  • Train/Validate/Test split
  • Hyperparameter tuning
  • Cross-validation

4. Serving

  • FastAPI with uvicorn
  • Docker container
  • Auto-scaling
  • p99 latency < 100ms

5. Monitoring

  • Model drift detection
  • A/B testing framework
  • Business metrics: CTR, conversion
  • Alert on degradation

Deliverables

  1. Python ML service (FastAPI + Docker)
  2. Data export scripts (WP-CLI)
  3. Feature engineering pipeline
  4. Training notebook (Jupyter)
  5. WordPress integration
  6. A/B testing framework
  7. Monitoring dashboard
  8. Model retraining schedule
  9. Cost analysis
  10. Fallback strategies

text

---

<a name="8"></a>
## 8๏ธโƒฃ Prompt: ุฃุฏูˆุงุช Admin ุงุญุชุฑุงููŠุฉ

```text
[ROLE]
ุฃู†ุช Frontend Engineer ู…ุชุฎุตุต ููŠ Admin Dashboards.

[TASK]
ุงุจู†ู Admin Dashboard ุงุญุชุฑุงููŠ ู„ุฅุถุงูุฉ WordPress ุจุงุณุชุฎุฏุงู… React.

## Dashboard Features
- ๐Ÿ“Š Real-time stats (KPIs)
- ๐Ÿ“ˆ Interactive charts (Chart.js / Recharts)
- ๐Ÿ“‹ DataTables ู…ุน filtering + sorting + pagination
- ๐Ÿ” Global search
- โšก Bulk actions
- ๐Ÿ“ค Export (CSV, Excel, PDF)
- ๐ŸŒ™ Dark mode
- ๐Ÿ“ฑ Responsive
- โ™ฟ Accessible (WCAG 2.1)

## Tech Stack
- React 18 + TypeScript
- @wordpress/components (Gutenberg UI)
- @wordpress/data (State management)
- @wordpress/api-fetch
- Recharts ู„ู„ู€ charts
- TanStack Table ู„ู„ู€ data grid
- Tailwind CSS ู„ู„ู€ styling

## Structure

admin-app/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ index.tsx โ† Entry
โ”‚ โ”œโ”€โ”€ App.tsx
โ”‚ โ”œโ”€โ”€ api/
โ”‚ โ”‚ โ””โ”€โ”€ client.ts โ† apiFetch wrapper
โ”‚ โ”œโ”€โ”€ store/
โ”‚ โ”‚ โ””โ”€โ”€ dataStore.ts โ† @wordpress/data
โ”‚ โ”œโ”€โ”€ components/
โ”‚ โ”‚ โ”œโ”€โ”€ Dashboard.tsx
โ”‚ โ”‚ โ”œโ”€โ”€ StatsCard.tsx
โ”‚ โ”‚ โ”œโ”€โ”€ RevenueChart.tsx
โ”‚ โ”‚ โ”œโ”€โ”€ OrdersTable.tsx
โ”‚ โ”‚ โ””โ”€โ”€ Filters.tsx
โ”‚ โ”œโ”€โ”€ hooks/
โ”‚ โ”‚ โ”œโ”€โ”€ useOrders.ts
โ”‚ โ”‚ โ””โ”€โ”€ useStats.ts
โ”‚ โ””โ”€โ”€ types/
โ”‚ โ””โ”€โ”€ index.ts
โ””โ”€โ”€ package.json

text

### 1. API Client
```typescript
import apiFetch from '@wordpress/api-fetch';

apiFetch.use(apiFetch.createNonceMiddleware(wpApiSettings.nonce));

export const getOrders = async (params: OrderParams): Promise<Order[]> => {
  return apiFetch({
    path: `/myplugin/v1/orders?${new URLSearchParams(params)}`,
  });
};

2. Data Store

typescript

import { createReduxStore, register } from '@wordpress/data';

const store = createReduxStore('myplugin/orders', {
  reducer(state = { orders: [], loading: false }, action) {
    switch (action.type) {
      case 'SET_ORDERS':
        return { ...state, orders: action.orders };
      case 'SET_LOADING':
        return { ...state, loading: action.loading };
      default:
        return state;
    }
  },
  actions: {
    setOrders: (orders) => ({ type: 'SET_ORDERS', orders }),
    fetchOrders: () => async ({ dispatch }) => {
      dispatch.setLoading(true);
      const orders = await getOrders();
      dispatch.setOrders(orders);
      dispatch.setLoading(false);
    },
  },
  selectors: {
    getOrders: (state) => state.orders,
    isLoading: (state) => state.loading,
  },
});

register(store);

3. Performance Optimizations

  • Virtual scrolling ู„ู„ู€ 10,000+ rows
  • Debounced search (300ms)
  • React.memo + useMemo
  • Code splitting per route
  • Prefetch on hover

4. Accessibility

  • ARIA labels
  • Keyboard navigation
  • Focus management
  • Screen reader announcements
  • Color contrast AA

Deliverables

  1. ู…ุดุฑูˆุน React ูƒุงู…ู„ + TypeScript
  2. Webpack config (@wordpress/scripts)
  3. API endpoints
  4. Data stores
  5. All components
  6. Charts examples
  7. DataTable with all features
  8. Dark mode toggle
  9. Accessibility audit report
  10. Performance: Lighthouse > 95
  11. i18n setup
  12. Storybook ู„ู„ู€ components

text

---

<a name="9"></a>
## 9๏ธโƒฃ Prompt: ุฃุชู…ุชุฉ DevOps ูƒุงู…ู„ุฉ

```text
[ROLE]
ุฃู†ุช DevOps Engineer ู…ุชุฎุตุต ููŠ WordPress ุนู„ู‰ ู†ุทุงู‚ ูˆุงุณุน.

[TASK]
ุงุจู†ู Pipeline ูƒุงู…ู„ ู„ู€ WordPress ู…ู† dev ุฅู„ู‰ production.

## Environments
- Local: DDEV / wp-env / Local by Flywheel
- Staging: Kinsta / WP Engine / VPS
- Production: AWS / DigitalOcean / Kinsta

## Pipeline Stages

### 1. Local Development
- Docker compose: WP + MySQL + Redis + Mailhog
- Xdebug for debugging
- Composer + NPM
- Git hooks (pre-commit: PHPCS)

### 2. CI (GitHub Actions)
```yaml
name: CI/CD Pipeline
on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: 8.2
      - run: composer install
      - run: composer run phpcs
      - run: composer run phpstan
      
  test:
    needs: lint
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:8
        env:
          MYSQL_ROOT_PASSWORD: root
        ports: [3306:3306]
    steps:
      - uses: actions/checkout@v4
      - run: composer install
      - run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1
      - run: composer run phpunit
      
  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci && npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: build
          path: build/
          
  deploy-staging:
    needs: build
    if: github.ref == 'refs/heads/develop'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
      - name: Deploy via SSH
        uses: easingthemes/ssh-deploy@main
        with:
          SSH_PRIVATE_KEY: ${{ secrets.STAGING_SSH_KEY }}
          REMOTE_HOST: ${{ secrets.STAGING_HOST }}
          SOURCE: build/
          TARGET: /var/www/staging/wp-content/plugins/myplugin/
      - name: Clear cache
        run: ssh ${{ secrets.STAGING_HOST }} 'wp cache flush'
        
  deploy-production:
    needs: build
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/download-artifact@v4
      - name: Deploy with zero-downtime
        run: |
          # Deploy to new release folder
          # Symlink switch
          # Health check
          # Rollback if fails

3. Infrastructure as Code (Terraform)

hcl

resource "aws_instance" "wordpress" {
  ami           = "ami-wordpress-latest"
  instance_type = "t3.medium"
  
  user_data = templatefile("${path.module}/init.sh", {
    db_host = aws_db_instance.main.address
    redis_endpoint = aws_elasticache_cluster.main.cache_nodes[0].address
  })
  
  tags = { Name = "wp-prod-${var.env}" }
}

4. Monitoring Stack

  • Prometheus + Grafana
  • Loki for logs
  • Sentry for errors
  • UptimeRobot
  • New Relic APM

5. Backup Strategy

  • Daily: DB dump โ†’ S3
  • Hourly: Files incremental โ†’ S3
  • Weekly: Full backup โ†’ Glacier
  • Monthly: Restore test

Deliverables

  1. docker-compose.yml (local)
  2. .github/workflows/ci.yml
  3. Terraform configs
  4. Ansible playbooks
  5. Kubernetes manifests (ุฅู† ู„ุฒู…)
  6. Monitoring setup
  7. Backup & restore scripts
  8. Rollback procedures
  9. Runbook documentation
  10. Cost optimization report

text

---

<a name="10"></a>
## ๐Ÿ”Ÿ ู†ู…ุงุฐุฌ Prompts ู„ู€ Bug Fixes ุญู‚ูŠู‚ูŠุฉ

### ๐Ÿ› Bug Fix #1: Memory Leak
```text
[SYMPTOM]
ุงู„ู…ูˆู‚ุน ูŠุณุชู‡ู„ูƒ 2GB RAM ุจุนุฏ 6 ุณุงุนุงุช ู…ู† ุงู„ุชุดุบูŠู„ุŒ ุซู… crashes.

[CONTEXT]
- WordPress 6.5 + WooCommerce
- PHP 8.2-FPM
- Redis object cache
- 5000 ู…ู†ุชุฌ

[INVESTIGATION PROMPT]
ุญู„ู‘ู„ ุงู„ุณูŠู†ุงุฑูŠูˆ ุงู„ุชุงู„ูŠ ูˆุญุฏุฏ ู…ุตุฏุฑ ุงู„ุชุณุฑูŠุจ:

1. ุชุญู‚ู‚ ู…ู†:
   - Global variables ุบูŠุฑ ู…ูุฑุบุฉ
   - Event listeners ุจุฏูˆู† removeEventListener
   - Database connections ุบูŠุฑ ู…ุบู„ู‚ุฉ
   - Transients ุบูŠุฑ ู…ู†ุชู‡ูŠุฉ
   - WP_Query ู…ุน posts_per_page => -1
   - Object cache ููŠ loop

2. ุฃุนุทู:
   - Script ู„ุชุชุจุน Memory Usage
   - Xdebug profiler setup
   - List of likely culprits
   - Solution ู„ูƒู„ ูˆุงุญุฏ

3. ุจุนุฏ ุงู„ุฅุตู„ุงุญ:
   - ู‚ุจู„: 2GB / 6h
   - ุจุนุฏ: ู…ุชูˆู‚ุน < 200MB
   - Test script ู„ู„ุชุญู‚ู‚

๐Ÿ› Bug Fix #2: Race Condition

text

[SYMPTOM]
ููŠ WooCommerceุŒ ุฃุญูŠุงู†ุงู‹ ูŠูุณุฌู‘ู„ ุงู„ุทู„ุจ ู…ุฑุชูŠู† ุนู†ุฏ checkout ุงู„ุณุฑูŠุน.

[PROMPT]
ู‡ุฐุง Race Condition ูƒู„ุงุณูŠูƒูŠ. ุญู„ู‘ู„ ูˆู‚ุฏู‘ู… ุญู„:

1. Root Cause:
   - Double form submissionุŸ
   - Concurrent requestsุŸ
   - Missing transaction locksุŸ

2. Solutions (ุฑุชุจู‡ุง ุญุณุจ ุงู„ุฃูˆู„ูˆูŠุฉ):
   A. Frontend: Disable button on submit + spinner
   B. Backend: Idempotency key per order
   C. Database: Unique constraint on (user_id, cart_hash, timestamp_window)
   D. Redis: Distributed lock (SETNX)

3. Code Implementation:
   - WooCommerce hook: woocommerce_checkout_process
   - Redis lock example
   - Idempotency middleware

4. Testing:
   - Apache Bench: ab -n 100 -c 10
   - Expected: only 1 order created

๐Ÿ› Bug Fix #3: N+1 Query Disaster

text

[SYMPTOM]
ุตูุญุฉ archive ุจู‡ุง 20 ู…ู†ุชุฌ โ†’ 340 queries!

[PROMPT]
ุญู„ู‘ู„ ูˆุงุณุชุจุฏู„ ุจู€ < 20 queries:

Before:
```php
foreach ($products as $product) {
    $author = get_userdata($product->post_author);       // +1
    $categories = wp_get_post_terms($product->ID, 'product_cat'); // +1
    $meta = get_post_meta($product->ID);                 // +1
    $reviews = get_comments(['post_id' => $product->ID]); // +1
}
// Total: 20 * 4 + 260 (WP core) = 340

After:

php

// Pre-fetch all in 4 queries
$author_ids = wp_list_pluck($products, 'post_author');
$author_map = get_users(['include' => $author_ids]);

$product_ids = wp_list_pluck($products, 'ID');
update_meta_cache('post', $product_ids);
update_term_cache($product_ids, 'product_cat');

$all_reviews = get_comments([
    'post_id__in' => $product_ids,
    'status' => 'approve',
]);

// Loop now uses cached data

ุงู„ู†ุชูŠุฌุฉ ุงู„ู…ุชูˆู‚ุนุฉ: < 20 queriesุŒ ุชุญุณู† 17x

text

---

<a name="11"></a>
## 1๏ธโƒฃ1๏ธโƒฃ ู†ู…ุงุฐุฌ Prompts ู„ู€ Architecture Decisions

### ๐Ÿ“ ADR Template Prompt
```text
[ROLE]
ุฃู†ุช Software Architect. ุงูƒุชุจ ADR (Architecture Decision Record).

[CONTEXT]
ู†ุญุชุงุฌ ุงุฎุชูŠุงุฑ ุญู„ ู„ู€ Caching ููŠ ู…ูˆู‚ุน WooCommerce ุจู€ 50k ู…ู†ุชุฌ.

[OPTIONS]
A. Redis Object Cache
B. Memcached
C. Varnish + Redis
D. Cloudflare APO
E. Nginx FastCGI Cache

[PROMPT]
ุงูƒุชุจ ADR ูŠุชุจุน ู‡ุฐุง ุงู„ู‚ุงู„ุจ:

# ADR-001: ุงุฎุชูŠุงุฑ ุญู„ ุงู„ู€ Caching

## Status
Proposed / Accepted / Deprecated

## Context
- ุงู„ู…ุดูƒู„ุฉ
- ุงู„ู‚ูŠูˆุฏ (Budget, Team, Tech stack)
- ุงู„ู…ุชุทู„ุจุงุช (Latency, Hit ratio)

## Decision
ู†ุฎุชุงุฑ: [ุงู„ุญู„] ู„ุฃู†ู‡...

## Consequences

### Positive
- ...

### Negative
- ...

### Neutral
- ...

## Alternatives Considered
1. Memcached โ€” ู„ู…ุงุฐุง ุฑููุถ
2. Varnish โ€” ู„ู…ุงุฐุง ุฑููุถ

## Implementation Plan
1. Phase 1: ...
2. Phase 2: ...

## Success Metrics
- TTFB: 2.5s โ†’ 0.3s
- DB Queries: 120 โ†’ 15
- Cache Hit Ratio: > 90%

## Review Date
2026-Q2

## References
- Benchmarks
- Articles
- Internal tests

๐Ÿ”„ Trade-off Analysis Prompt

text

[ROLE]
ุฃู†ุช CTO. ุญู„ู‘ู„ Trade-offs ุจูŠู† ุญู„ูŠู†.

[DECISION]
ุงุฎุชูŠุงุฑ REST vs GraphQL ู„ู…ุดุฑูˆุน Headless WordPress.

[PROMPT]
ุฃุนุทู ุฌุฏูˆู„ ู…ู‚ุงุฑู†ุฉ ุดุงู…ู„:

| ุงู„ู…ุนูŠุงุฑ | REST | GraphQL | ุงู„ูุงุฆุฒ |
|---------|------|---------|--------|
| Over-fetching | โŒ | โœ… | GraphQL |
| Under-fetching | โŒ | โœ… | GraphQL |
| Caching | โœ… | โš ๏ธ | REST |
| Learning curve | โœ… | โš ๏ธ | REST |
| Tooling | โœ… | โœ… | = |
| Real-time | โš ๏ธ | โœ… | GraphQL |
| Security | โœ… | โš ๏ธ | REST |
| Mobile efficiency | โš ๏ธ | โœ… | GraphQL |

ุซู… ุฃุถู:
1. Decision Matrix ู…ูˆุฒูˆู† ุญุณุจ ุฃูˆู„ูˆูŠุงุช ุงู„ู…ุดุฑูˆุน
2. Cost analysis (dev time, infra)
3. Team readiness assessment
4. Migration complexity
5. Final recommendation ู…ุน 3 ุณูŠู†ุงุฑูŠูˆู‡ุงุช

<a name=”12″></a>

1๏ธโƒฃ2๏ธโƒฃ Anti-Patterns: ุฃุฎุทุงุก ุดุงุฆุนุฉ ููŠ ุงู„ู€ Prompts

โŒ ุฎุทุฃ #1: Vague Request

text

ุณูŠุฆ: "ุงูƒุชุจ ูƒูˆุฏ ู„ู…ูˆู‚ุนูŠ"
ุฌูŠุฏ: "ุงูƒุชุจ class Cart ู„ู€ WooCommerce ูŠุฏุนู… ุงู„ูƒูˆุจูˆู†ุงุช 
      ู…ุน validation ู„ู„ุฃู…ุงู†"

โŒ ุฎุทุฃ #2: No Context

text

ุณูŠุฆ: "ุฃุตู„ุญ ุงู„ุฎุทุฃ"
ุฌูŠุฏ: "Fatal error: Call to undefined method WC_Order::get_total()
      ูŠุญุฏุซ ุนู†ุฏ ุชูุนูŠู„ ุงู„ุฅุถุงูุฉ. WC 8.5, PHP 8.2, HPOS enabled.
      Stack trace: ..."

โŒ ุฎุทุฃ #3: No Constraints

text

ุณูŠุฆ: "ุงุณุชุฎุฏู… ุฃูŠ ู…ูƒุชุจุฉ"
ุฌูŠุฏ: "ู„ุง ุชุณุชุฎุฏู… ู…ูƒุชุจุงุช ุฎุงุฑุฌูŠุฉ. ูู‚ุท WordPress Core APIs"

โŒ ุฎุทุฃ #4: No Output Format

text

ุณูŠุฆ: "ุฃุนุทู†ูŠ ุงู„ุญู„"
ุฌูŠุฏ: "ุฃุนุทู†ูŠ:
      1. Schema ู‚ุงุนุฏุฉ ุงู„ุจูŠุงู†ุงุช
      2. ุงู„ูƒูˆุฏ ุงู„ูƒุงู…ู„
      3. Tests
      4. Deployment steps"

โŒ ุฎุทุฃ #5: Single-Shot Complex Request

text

ุณูŠุฆ: "ุงุจู†ู ู…ู†ุตุฉ ุชุนู„ูŠู…ูŠุฉ ูƒุงู…ู„ุฉ ููŠ ุฑุณุงู„ุฉ"
ุฌูŠุฏ: ู‚ุณู‘ู…ู‡ุง ู„ู…ุฑุงุญู„:
      Phase 1: Database + CPTs
      Phase 2: REST API
      Phase 3: Frontend
      Phase 4: Payments

โœ… Prompt Optimization Checklist

markdown

- [ ] ุญุฏู‘ุฏ ุงู„ุฏูˆุฑ (Role)
- [ ] ุฃุนุทู ุงู„ุณูŠุงู‚ (Context)
- [ ] ุญุฏู‘ุฏ ุงู„ู…ู‡ู…ุฉ ุจุฏู‚ุฉ (Task)
- [ ] ุงุฐูƒุฑ ุงู„ู‚ูŠูˆุฏ (Constraints)
- [ ] ุญุฏู‘ุฏ ุตูŠุบุฉ ุงู„ู…ุฎุฑุฌุงุช (Output)
- [ ] ุฃุถู ุฃู…ุซู„ุฉ (Examples)
- [ ] ุงุทู„ุจ ุงุฎุชุจุงุฑุงุช (Tests)
- [ ] ุงุทู„ุจ ุชูˆุซูŠู‚ุงู‹ (Docs)
- [ ] ุงุทู„ุจ ู…ุฑุงุฌุนุฉ ุฐุงุชูŠุฉ (Review)
- [ ] ุงุฐูƒุฑ ู…ุนุงูŠูŠุฑ ุงู„ู‚ุจูˆู„ (Acceptance Criteria)

<a name=”13″></a>

1๏ธโƒฃ3๏ธโƒฃ Cheat Sheet ู†ู‡ุงุฆูŠ

๐ŸŽฏ Prompt Matrix ุญุณุจ ุงู„ุญุงู„ุฉ

ุงู„ุญุงู„ุฉPersonaKey PhrasesOutput
Bug FixDebugger“Root cause”, “Stack trace”, “Reproduce”RCA + Fix + Test
FeatureSenior Dev“Best practices”, “Edge cases”, “Scale”Code + Tests + Docs
ReviewTech Lead“Risks”, “Anti-patterns”, “Performance”๐Ÿ”ด๐ŸŸก๐ŸŸข List
RefactorArchitect“SOLID”, “DRY”, “Testability”Before/After
OptimizePerformance Eng“Big O”, “Queries”, “Memory”Metrics + Code
SecureSecurity Eng“OWASP”, “Sanitize”, “Escape”Audit + Fixes
DesignArchitect“Trade-offs”, “ADR”, “Scale”Diagram + ADR
TestQA Engineer“Coverage”, “Edge cases”, “Mock”Tests + Report
DeployDevOps“CI/CD”, “Rollback”, “Monitoring”Pipeline + IaC

๐Ÿš€ Ultimate Prompt Template

markdown

# [ROLE]
ุฃู†ุช [X] ุจุฎุจุฑุฉ [N] ุณู†ูˆุงุช ููŠ [domains].

# [CONTEXT]
- Project: ...
- Stack: ...
- Scale: ...
- Constraints: ...

# [TASK]
ุงูƒุชุจ/ุญู„ู‘ู„/ุญุณู‘ู† ... [ุจุงู„ุชูุตูŠู„]

# [REQUIREMENTS]
1. ...
2. ...
3. ...

# [CONSTRAINTS]
โœ… Must: ...
โŒ Never: ...
โš ๏ธ Prefer: ...

# [OUTPUT FORMAT]
1. Diagram
2. Code (with comments)
3. Tests
4. Docs
5. Deployment

# [QUALITY CHECKLIST]
- [ ] Security (OWASP)
- [ ] Performance (Queries < X)
- [ ] Standards (PSR-12)
- [ ] Tests (Coverage > 80%)
- [ ] i18n
- [ ] Accessibility
- [ ] Documentation

# [SUCCESS METRICS]
- Metric 1: X โ†’ Y
- Metric 2: A โ†’ B

๐ŸŽ ู‡ุฏูŠุฉ ู†ู‡ุงุฆูŠุฉ: 15 Persona Prompt ุฌุงู‡ุฒ

text

1. Senior WP Plugin Developer
2. WooCommerce Extension Expert  
3. WordPress Core Contributor
4. Gutenberg Block Developer
5. Headless WordPress Architect
6. WordPress Performance Engineer
7. WordPress Security Auditor
8. WordPress DevOps Engineer
9. WordPress AI Engineer
10. WordPress Testing Specialist
11. WordPress Multi-tenant Architect
12. WordPress API Designer
13. WordPress Accessibility Expert
14. WordPress Migration Expert
15. WordPress Code Reviewer

๐Ÿ”ฅ ู†ุตูŠุญุฉ ุฃุฎูŠุฑุฉ

ุงู„ู€ Prompt ุงู„ุฌูŠุฏ = 50% ู…ู† ุงู„ูƒูˆุฏ ุงู„ุฌูŠุฏ

ูƒู„ ุฏู‚ูŠู‚ุฉ ุชุณุชุซู…ุฑู‡ุง ููŠ ูƒุชุงุจุฉ prompt ุฏู‚ูŠู‚ุŒ
ุชูˆูุฑ ุนู„ูŠูƒ 30 ุฏู‚ูŠู‚ุฉ ููŠ ุชุตุญูŠุญ ูƒูˆุฏ ุบุงู…ุถ.

ุงุณุชุฎุฏู… Iterative Refinement:
Prompt โ†’ Code โ†’ Review โ†’ Refine โ†’ Repeat


๐Ÿ“ž ุชุฑูŠุฏ ุŸ

ุฃุฎุจุฑู†ูŠ ุฃูŠ ู…ุฌุงู„ ุชุฑูŠุฏ ุฃู† ุฃุนู…ู‘ู‚ ููŠู‡:

  • ๐Ÿ”Œย WooCommerceย (Subscriptions, Bookings, Memberships)
  • ๐Ÿค–ย AI Integrationย (Agents, RAG, Fine-tuning)
  • ๐Ÿ—๏ธย Architectureย (Microservices, Event-driven)
  • ๐ŸŽจย Frontendย (React, Next.js, Vue ููŠ WP)
  • ๐Ÿ”’ย Securityย (Penetration testing, Hardening)
  • โšกย Performanceย (Load testing, Optimization)
  • ๐Ÿš€ย DevOpsย (Kubernetes, Terraform, CI/CD)
  • ๐Ÿ“ฑย Mobileย (WP REST + React Native)

ุงุฎุชุฑ ูˆุชุนู…ู‘ู‚! ๐ŸŽฏ

Scroll to Top

๐Ÿค– ู…ูˆุตู‰ ุจู‡ ู„ูƒ ุจู†ุงุกู‹ ุนู„ู‰ ุงู‡ุชู…ุงู…ุงุชูƒ