Prompt Engineering ูู ุดุงุฑูุน PHP/WordPress/WooCommerce ุงูุฅูุชุงุฌูุฉ
ุจุตูุชู ู ููุฏุณ ุจุฑู ุฌูุงุช ุจุฎุจุฑุฉ 15+ ุณูุฉ ูู ุจูุงุก ุญููู ุฅูุชุงุฌูุฉ ู ุนูุฏุฉุ ุณุฃุดุงุฑูู ุงูู ููุฌูุฉ ุงูุงุญุชุฑุงููุฉ ุงูุชู ุฃุณุชุฎุฏู ูุง ุดุฎุตูุงู ูุตูุงุบุฉ Prompts ุชููุชุฌ ููุฏ production-ready ุญูููู โ ููุณ ุชุฌุงุฑุจ ููุง demos.
๐งฉ ุงูู ุดููุฉ ุงูุฃุณุงุณูุฉ ู ุน Prompts ุงูุนุงุฏูุฉ
ู ุนุธู ุงูู ุทูุฑูู ููุชุจูู:
“ุงูุชุจ ูู plugin WooCommerce ูุญุณุงุจ ุงูุดุญู”
ุงููุชูุฌุฉ: ููุฏ toyุ ุจุฏูู noncesุ ุจุฏูู sanitizationุ ุจุฏูู hooks ุตุญูุญุฉุ ุจุฏูู error handlingุ ุจุฏูู i18nุ ุจุฏูู tests.
ุงูุญู: Prompt ู ูููุฏูุณ ุจู 6 ุฃุนู ุฏุฉ ุฃุณุงุณูุฉ.
๐๏ธ ุงูุฃุนู ุฏุฉ ุงูุณุชุฉ (The 6 Pillars Framework)
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ 1. ุงูุณูุงู (Context) โ ูุญุฏุฏ ุงูุจูุฆุฉ โ โ 2. ุงูุฏูุฑ (Role) โ ูุญุฏุฏ ุงูุฎุจุฑุฉ โ โ 3. ุงูู ูู ุฉ (Task) โ ูุญุฏุฏ ุงููุทุงู โ โ 4. ุงูู ุนุงููุฑ (Standards) โ ูุญุฏุฏ ุงูุฌูุฏุฉ โ โ 5. ุงููููุฏ (Constraints) โ ูุญุฏุฏ ุงูุญุฏูุฏ โ โ 6. ุงูุชูุณูู (Format) โ ูุญุฏุฏ ุงูุชุณููู ุงุช โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1๏ธโฃ ุงูุณูุงู (Context) โ ุงูุจูุฆุฉ ุงูุชูููุฉ ุงููุงู ูุฉ
โ๏ธ ู ุง ูุฌุจ ุชุญุฏูุฏู ุฏุงุฆู ุงู:
yaml
Environment: Server: Nginx 1.24 / Apache 2.4 OS: Ubuntu 22.04 LTS PHP: 8.2 (FPM) Memory Limit: 512M WordPress: 6.5+ WooCommerce: 8.7+ MySQL: 8.0 / MariaDB 10.6 Object Cache: Redis 7.x CDN: Cloudflare Multisite: No HPOS: Enabled (High-Performance Order Storage) Target Audience: - B2B wholesale buyers - Arabic + English markets - 10k+ SKUs, 500+ daily orders Existing Stack: - Theme: Custom (block theme) - Payment: Stripe + Tap + MyFatoorah - Shipping: Aramex API integration
๐ก ู ุซุงู Prompt ุถุนูู vs ููู:
| โ ุถุนูู | โ ููู |
|---|---|
| “WordPress plugin” | “WP 6.5, PHP 8.2, WC 8.7, HPOS enabled, Redis cache, 10k SKUs” |
| “Users” | “B2B wholesale, 500 orders/day, Arabic RTL” |
2๏ธโฃ ุงูุฏูุฑ (Role) โ ุชุญุฏูุฏ ุงูุดุฎุตูุฉ ุจุฏูุฉ
ุงูุฃุฏูุงุฑ ุงูู ุชุฎุตุตุฉ ุงูุชู ุฃุณุชุฎุฏู ูุง:
markdown
# Primary Role Senior WordPress/WooCommerce Engineer - 15+ years PHP OOP (PSR-12) - Core contributor mindset - Deep knowledge: WordPress hooks lifecycle, WC CRUD, HPOS, REST API v3 # Secondary Roles (activated per task) - Architect: ุชุตู ูู ุงูุจููุฉ ูุงูุชูุณุน - Security Auditor: ู ุฑุงุฌุนุฉ ุงูุซุบุฑุงุช - Performance Eng: ุชุญุณูู ุงูุงุณุชุนูุงู ุงุช - Code Reviewer: ู ุฑุงุฌุนุฉ PRs - TDD Practitioner: ูุชุงุจุฉ tests ุฃููุงู
๐ก ู ุซุงู ุตูุงุบุฉ ุงูุฏูุฑ:
text
ุฃูุช Senior WooCommerce Engineer ุจุฎุจุฑุฉ 15 ุณูุฉุ ุนู ูุช ุนูู ู ุดุงุฑูุน +50k SKU. ุชุชูู: - WC_Order CRUD + HPOS compatibility - Custom tables + $wpdb->prepare - Action Scheduler ููุฃุฏุงุก - REST API v3 + JWT auth - PHPUnit + WP_Mock ููู testing
3๏ธโฃ ุงูู ูู ุฉ (Task) โ ูุตู ูุงุจู ููููุงุณ
ุงููุงุนุฏุฉ ุงูุฐูุจูุฉ: SMART Task
text
Specific โ ู ุงุฐุง ุจุงูุถุจุทุ Measurable โ ููู ูููุณ ุงููุฌุงุญุ Achievable โ ูู ู ู ูู ุชูููุงูุ Relevant โ ูู ูุฎุฏู ุงููุฏูุ Time-bound โ ู ููุฉ ุงูุชุณููู ุ
โ๏ธ ูุงูุจ ุงูู ูู ุฉ ุงูุงุญุชุฑุงูู:
markdown
## Task
Build a custom WooCommerce plugin that applies tiered
wholesale pricing based on:
- User role (wholesale_bronze/silver/gold)
- Product category
- Cart total thresholds
## Inputs
- User role from `wp_get_current_user()->roles`
- Product data via `wc_get_product($id)`
- Cart via `WC()->cart`
## Outputs
1. Modified price via `woocommerce_product_get_price` filter
2. Cart notice via `woocommerce_before_cart`
3. Admin settings page (WP Settings API)
4. REST endpoint: `/wp-json/wc-wholesale/v1/price/{product_id}`
## Success Criteria
- [ ] Price updates in < 50ms (cached)
- [ ] 100% HPOS compatible
- [ ] Zero SQL errors at 10k products
- [ ] PHPUnit coverage โฅ 80%
- [ ] Passes PHPCS with WPCS standard
4๏ธโฃ ุงูู ุนุงููุฑ (Standards) โ ุงูุฌูุฏุฉ ุบูุฑ ูุงุจูุฉ ููุชูุงูุถ
๐ ุงูุฃู ุงู (Security) โ checklist ุฅูุฒุงู ู:
php
// โ
Nonces
wp_nonce_field('save_pricing', 'pricing_nonce');
if (!wp_verify_nonce($_POST['pricing_nonce'], 'save_pricing')) {
wp_die('Security check failed');
}
// โ
Sanitization
$price = (float) sanitize_text_field($_POST['price']);
$role = sanitize_key($_POST['role']);
$email = sanitize_email($_POST['email']);
$html = wp_kses_post($_POST['description']);
// โ
Escaping (output)
echo esc_html($product->get_name());
echo esc_attr($class);
echo esc_url($link);
echo wp_kses_post($html);
// โ
Prepared Statements
$results = $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}wholesale_prices
WHERE role = %s AND product_id = %d",
$role,
$product_id
)
);
// โ
Capability Checks
if (!current_user_can('manage_woocommerce')) {
return new WP_Error('forbidden', 'Access denied', ['status' => 403]);
}
๐จ Coding Standards:
| ุงูู ุนูุงุฑ | ุงูุชุทุจูู |
|---|---|
| PSR-12 | ููุงุณ structureุ namespaces |
| WPCS | namingุ tabsุ Yoda conditions |
| PSR-4 | Autoloading |
| i18n | ูู ูุต ุนุจุฑ __() / _e() |
| PHPDoc | ูู method ู ูุซููุฉ |
โก Performance:
php
// โ
Transients ููู expensive queries
$data = get_transient('wc_wholesale_prices');
if (false === $data) {
$data = $wpdb->get_results(/* ... */);
set_transient('wc_wholesale_prices', $data, HOUR_IN_SECONDS);
}
// โ
Object Cache
wp_cache_get($key, 'wholesale');
wp_cache_set($key, $value, 'wholesale', 3600);
// โ
Action Scheduler ููู
ูุงู
ุงูุซูููุฉ
as_enqueue_async_action('sync_wholesale_prices', ['batch_id' => 1]);
// โ
ุชุฌูุจ N+1 queries
$product_ids = wp_list_pluck($items, 'product_id');
$products = wc_get_products(['include' => $product_ids, 'limit' => -1]);
๐งช Testing:
php
class WholesalePricingTest extends WP_UnitTestCase {
public function test_gold_role_gets_30_percent_discount(): void {
$user = $this->factory->user->create(['role' => 'wholesale_gold']);
wp_set_current_user($user);
$product = WC_Helper_Product::create_simple_product();
$product->set_regular_price(100);
$product->save();
$this->assertEquals(70, $product->get_price());
}
}
5๏ธโฃ ุงููููุฏ (Constraints) โ ุงูุญุฏูุฏ ุงููุงุถุญุฉ
markdown
## Technical Constraints - โ ูุง ุชุนุฏูู ุนูู core files - โ ูุง ุชุนุฏูู ุนูู theme ู ุจุงุดุฑุฉ - โ ููุท hooks/filters ุฑุณู ูุฉ - โ PHP 8.2+ ููุท (ูุง backward compatibility) - โ WordPress Coding Standards ## Business Constraints - Delivery: 3 days - Budget: Fixed - ูุง dependencies ุฎุงุฑุฌูุฉ (Composer ููุท ูู dev) ## Compatibility - โ HPOS - โ WooCommerce Blocks - โ WPML / Polylang - โ Cache plugins (WP Rocket, LiteSpeed)
6๏ธโฃ ุงูุชูุณูู (Format) โ ุงูุชุณููู ุงุช ุงูููุงุฆูุฉ
๐ ุจููุฉ ุงูู ููุงุช ุงูู ุทููุจุฉ:
text
wholesale-pricing/
โโโ wholesale-pricing.php # Main plugin file
โโโ uninstall.php # Cleanup
โโโ composer.json
โโโ phpunit.xml
โโโ readme.txt
โโโ includes/
โ โโโ class-plugin.php # Singleton
โ โโโ class-activator.php
โ โโโ class-deactivator.php
โ โโโ Pricing/
โ โ โโโ class-calculator.php
โ โ โโโ class-rules-engine.php
โ โโโ Admin/
โ โ โโโ class-settings.php
โ โ โโโ views/settings-page.php
โ โโโ REST/
โ โโโ class-price-controller.php
โโโ assets/
โ โโโ css/admin.css
โ โโโ js/admin.js
โโโ languages/
โ โโโ wholesale-pricing-ar.po
โโโ tests/
โโโ bootstrap.php
โโโ test-pricing.php
๐ ุงูุชุณููู ุงุช (Deliverables):
markdown
1. โ ููุฏ ูุงู ู production-ready 2. โ PHPUnit tests (coverage โฅ 80%) 3. โ PHPDoc ููู method 4. โ readme.txt ุจุตูุบุฉ WP.org 5. โ README.md ููู ุทูุฑูู 6. โ Migration script ุฅู ูุฒู 7. โ Rollback plan 8. โ Performance benchmark report
๐ฌ ุงููุงูุจ ุงููุงู ู ุงูุฌุงูุฒ ููุงุณุชุฎุฏุงู
markdown
# ROLE ุฃูุช Senior WooCommerce Engineer ุจุฎุจุฑุฉ 15+ ุณูุฉุ ู ุชุฎุตุต ูู HPOSุ REST API v3ุ Performance Optimizationุ ูู ุดุงุฑูุน +50k SKU. # CONTEXT - WordPress 6.5+, WooCommerce 8.7+, PHP 8.2, MySQL 8.0 - HPOS enabled, Redis cache, Nginx - B2B wholesale: 10k SKUs, 500 orders/day - Market: Arabic + English # TASK [ูุตู ุฏููู + Inputs + Outputs + Success Criteria] # STANDARDS (ุบูุฑ ูุงุจูุฉ ููุชูุงูุถ) - Security: nonces + sanitization + escaping + prepared statements - Standards: PSR-12 + WPCS + PHPDoc + i18n - Performance: caching + Action Scheduler + no N+1 - Testing: PHPUnit โฅ 80% coverage - Compatibility: HPOS, Blocks, WPML # CONSTRAINTS - ูุง ุชุนุฏูู core/theme - Hooks ุฑุณู ูุฉ ููุท - PHP 8.2+ only - Composer ูู dev ููุท # FORMAT - Structure: [ุดุฌุฑุฉ ุงูู ููุงุช] - Deliverables: [ูุงุฆู ุฉ] - Documentation: [ู ุณุชูู ุงูุชูุซูู] # OUTPUT ุงุจุฏุฃ ุจู: 1. ุชุญููู ู ุฎุชุตุฑ ููุจููุฉ 2. ุดุฌุฑุฉ ุงูู ููุงุช 3. ุงูููุฏ ูุงู ูุงู 4. ุงูุงุฎุชุจุงุฑุงุช 5. ู ูุงุญุธุงุช ู ุง ุจุนุฏ ุงููุดุฑ
๐ ูุตุงุฆุญ ู ู 15 ุณูุฉ ุฎุจุฑุฉ
๐ฏ 3 ููุงุนุฏ ุฐูุจูุฉ:
- ุงูุณูุงู ุฃููุงูุ ุงูููุฏ ุซุงููุงู โ AI ุจุฏูู ุณูุงู = ููุฏ toy
- Standards ููุณุช ุงุฎุชูุงุฑูุฉ โ ุฃุถููุง ุฏุงุฆู ุงูุ ูุฅูุง ุณุชุญุตู ุนูู ููุฏ ุบูุฑ ุขู ู
- ูุณูู ุงูู ูู ุฉ ุงูู ุนูุฏุฉ โ plugin ูุงู ู = 5-10 prompts ู ุชุณูุณูุฉุ ููุณ prompt ูุงุญุฏ
๐ ุงุณุชุฑุงุชูุฌูุฉ ุงูุชุณูุณู (Chaining):
text
Prompt 1: Architecture + File Structure Prompt 2: Database Schema + Migrations Prompt 3: Core Classes (Calculator, Rules Engine) Prompt 4: Admin UI + Settings Prompt 5: REST API Prompt 6: Tests + CI/CD Prompt 7: Documentation + Deployment
โ ๏ธ ุฃุฎุทุงุก ุดุงุฆุนุฉ ูุฌุจ ุชุฌูุจูุง:
| ุงูุฎุทุฃ | ุงูุญู |
|---|---|
| “ุงูุชุจ plugin ูุงู ู” | ูุณูู ูู phases |
| ุชุฌุงูู HPOS | ุฃุถููุง ูู Constraints |
| ูุณูุงู i18n | ุงุทูุจูุง ูู Standards |
| ุนุฏู ุชุญุฏูุฏ PHP version | ุญุฏุฏูุง ุจุฏูุฉ |
| ุนุฏู ุทูุจ tests | ุงุทูุจูุง ูู Deliverables |
๐ ูู ุชุฑูุฏ ุงูุชุทุจูู ุงูุนู ููุ
ุฃุนุทูู ุฃุญุฏ ูุฐู ุงูุณููุงุฑูููุงุช ูุณุฃุตูุบ ูู Prompt ุฅูุชุงุฌู ูุงู ู ุฌุงูุฒ ููุงุณุชุฎุฏุงู :
- ๐ง Custom WooCommerce Shipping Plugin
- ๐ฐ Dynamic Pricing Rules Engine
- ๐ REST API Integration ู ุน ูุธุงู ุฎุงุฑุฌู
- ๐ Custom Reports Dashboard
- ๐จ Custom Checkout Flow
- ๐ B2B Wholesale System ูุงู ู
ุฃุฎุจุฑูู ุจุงูุณููุงุฑูู + ุงูุจูุฆุฉ ุงูุชูููุฉ + ุงูู ุชุทูุจุงุชุ ูุณุฃุตูุบ ูู Prompt ุงุญุชุฑุงูู ุฌุงูุฒ ููุฅูุชุงุฌ. ๐ฏ
๐ ุงูุชูุณูุน ุงูุนู ูู: ู ู Prompt ุฌูุฏ ุฅูู Prompt ุฅูุชุงุฌู ุงุญุชุฑุงูู
ุณุฃูู ู ู ุนู ุงูู ููุฌูุฉ ุจู ุณุชูู ุฃุนู ู โ ู ุง ุจุนุฏ ุงูุฃุนู ุฏุฉ ุงูุณุชุฉ. ูุฐุง ูู ุงููุฑู ุจูู ู ุทูุฑ ูุณุชุฎุฏู AIุ ูู ููุฏุณ ูุจูู ุฃูุธู ุฉ ุฅูุชุงุฌูุฉ ุจู AI.
๐๏ธ ุงูุฌุฒุก ุงูุซุงูู: ุงูุทุจูุงุช ุงูู ุชูุฏู ุฉ (Advanced Layers)
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Layer 7: Prompt Chaining & Orchestration โ โ Layer 6: Validation & Guardrails โ โ Layer 5: Anti-Patterns Detection โ โ Layer 4: Context Compression โ โ Layer 3: Examples & Few-Shot Design โ โ Layer 2: Output Contracts โ โ Layer 1: The 6 Pillars (ุงูุณุงุจู) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
7๏ธโฃ Prompt Chaining โ ุงูุชุณูุณู ุงูุงุญุชุฑุงูู
โ ุงูุฎุทุฃ ุงูุดุงุฆุน:
“ุงุจูู ูู plugin WooCommerce ูุงู ู” โ ูุชูุฌุฉ ุณุทุญูุฉ
โ ุงูุงุญุชุฑุงู: ุชูุณูู ุฅูู 7 ู ุฑุงุญู ู ูุชุฑุงุจุทุฉ
๐ ูุงูุจ ูู Phase:
markdown
## Phase N: [ุงูุงุณู ] ### Prerequisites (ุงูู ุฎุฑุฌุงุช ู ู Phase ุงูุณุงุจู) - ุงูู ููุงุช ุงูู ูุฌูุฏุฉ - ุงูู Interfaces ุงูู ุนุฑููุฉ - ุงูู Tests ุงูู ูุชูุจุฉ ### Objectives (ุฃูุฏุงู ูุฐู ุงูู ุฑุญูุฉ) 1. ... 2. ... ### Deliverables (ุงูุชุณููู ุงุช) - [ ] ู ูู ูุฐุง - [ ] Tests ูุฐุง - [ ] Documentation ูุฐุง ### Validation Gate (ุจูุงุจุฉ ุงูุชุญูู ูุจู ุงูุงูุชูุงู) - [ ] PHPCS pass - [ ] PHPUnit pass - [ ] Manual QA checklist ### Handoff (ู ุง ููุณูููู ููู ุฑุญูุฉ ุงูุชุงููุฉ) - Interfaces ุฌุงูุฒุฉ - Constants ู ุญุฏุฏุฉ - Hooks ู ุณุฌูุฉ
๐ก ู ุซุงู ุนู ูู: Phase 2 โ Phase 3 Handoff
php
// Phase 2 ูููุชุฌ ูุฐุง ุงูู Contract:
interface Price_Calculator_Interface {
public function calculate(int $product_id, int $user_id): float;
public function get_rules(): array;
public function invalidate_cache(int $product_id): void;
}
// Phase 3 ูุจูู ุนููู:
final class Tiered_Price_Calculator implements Price_Calculator_Interface {
// implementation
}
8๏ธโฃ Output Contracts โ ุนููุฏ ุงูู ุฎุฑุฌุงุช
๐ฏ ูู ุงุฐุงุ
AI ูู
ูู ูููุณู: ูุนุทูู // TODO ุฃู ููุฏ ูุงูุต. Output Contract ูุฌุจุฑู ุนูู ุงูุงูุชู
ุงู.
โ๏ธ ูุงูุจ Output Contract:
markdown
## Output Contract (ุฅูุฒุงู
ู)
### ููู ู
ูู PHP:
โ
`declare(strict_types=1);` ูู ุงูุณุทุฑ ุงูุฃูู
โ
namespace ูุงู
ู
โ
PHPDoc ููู class + method ุนุงู
โ
`defined('ABSPATH') || exit;` ูู ุจุฏุงูุฉ ูู ู
ูู
โ
ูุง ููุฌุฏ `// TODO` ุฃู `// ...` โ ุงูููุฏ ูุงู
ู
โ
ูู method โค 30 ุณุทุฑ (Single Responsibility)
โ
ูู class โค 300 ุณุทุฑ (ุฅุฐุง ุฒุงุฏ โ ุงูุชุฑุญ ุชูุณูู
)
### ููู method:
โ
Return type declared
โ
Parameter types declared
โ
PHPDoc ูุดุฑุญ: @param, @return, @throws
โ
Error handling ูุงุถุญ (WP_Error ุฃู Exception)
### ููู hook:
โ
Priority ู
ุญุฏุฏ ุจูุถูุญ
โ
Accepted args ู
ุญุฏุฏ
โ
Callback type-hinted
### ููู query:
โ
$wpdb->prepare ุฅูุฒุงู
ู
โ
Index verification
โ
Query time estimate ูู comment
### ููู test:
โ
Test name ูุงุถุญ (test_should_X_when_Y)
โ
Arrange-Act-Assert pattern
โ
No hardcoded values (ุงุณุชุฎุฏู
factories)
๐ฅ ู ุซุงู ููุถุญ ุงููุฑู:
ุจุฏูู Contract:
php
public function get_price($id) {
// TODO: add logic
return 0;
}
ู ุน Contract:
php
/**
* Calculate the final price for a product based on user tier.
*
* @param int $product_id WooCommerce product ID.
* @param int $user_id WordPress user ID (0 for guest).
*
* @return float Final price after tier discount, min 0.0.
* @throws InvalidArgumentException If product_id โค 0.
*
* @since 1.0.0
*/
public function get_price(int $product_id, int $user_id = 0): float {
if ($product_id <= 0) {
throw new InvalidArgumentException('Invalid product ID');
}
$product = wc_get_product($product_id);
if (!$product) {
return 0.0;
}
$base_price = (float) $product->get_price();
$tier = $this->resolve_user_tier($user_id);
$discount = $this->rules_engine->get_discount($tier, $product_id);
return max(0.0, $base_price * (1 - $discount));
}
9๏ธโฃ Anti-Patterns Detection โ ูุดู ุงูุฃุฎุทุงุก ุงูุดุงุฆุนุฉ
๐จ ูุงุฆู ุฉ Anti-Patterns ุงูุชู ูุฌุจ ุฃู ูุฑูุถูุง AI:
markdown
## Anti-Patterns Blocklist ### ุฃู ููุงู (Security) โ ุงุณุชุฎุฏุงู $_POST / $_GET ู ุจุงุดุฑุฉ โ echo ุจุฏูู escaping โ SQL ุจุฏูู prepare โ AJAX ุจุฏูู nonce check โ file_get_contents ุนูู URL ุฎุงุฑุฌู ุจุฏูู wp_remote_get โ unserialize ุนูู ู ุฏุฎูุงุช ุงูู ุณุชุฎุฏู โ eval / create_function / extract ### ุฃุฏุงุฆูุงู (Performance) โ ุงุณุชุนูุงู ุงุช ุฏุงุฎู loop (N+1) โ get_posts ู ุน post__in ุถุฎู โ ุนุฏู ุงุณุชุฎุฏุงู transients ููุงุณุชุนูุงู ุงุช ุงูู ูููุฉ โ ุชุญู ูู ุณูุฑุจุชุงุช ูู ูู ุงูุตูุญุงุช (ูุฌุจ conditional) โ ุงูุงุณุชุนูุงู ุนู postmeta ุจุฏูู index โ ุงุณุชุฎุฏุงู query_posts ### ู ุนู ุงุฑูุงู (Architecture) โ ู ูุทู ุงูุฃุนู ุงู ุฏุงุฎู template files โ ููุงุณ ุนู ูุงู ููุนู ูู ุดูุก (God Class) โ Static methods ุชุฎูู dependencies โ Singleton ููู ุดูุก โ ุนุฏู ุงุณุชุฎุฏุงู Dependency Injection โ ุชุฌุงูุฒ hooks ูุฅุนุงุฏุฉ ุงุฎุชุฑุงุน ุงูุนุฌูุฉ ### ุชูุงูููุงู (Compatibility) โ ููุฏ ููุณุฑ HPOS โ ุชุฌุงูู WooCommerce Blocks โ ุนุฏู ุงุฎุชุจุงุฑ ู ุน WPML/Polylang โ ุงุณุชุฎุฏุงู ุฏูุงู deprecated โ ุนุฏู ุฏุนู PHP 8.2 strict types
๐ก ููู ุชูุฏู ุฌูุง ูู Prompt:
markdown
## Validation Rules ุจุนุฏ ูุชุงุจุฉ ุงูููุฏุ ุฑุงุฌุน ููุณู ุถุฏ: 1. ูุงุฆู ุฉ Anti-Patterns ุงูุฃู ููุฉ โ ูุฌุจ ุตูุฑ violations 2. ูุงุฆู ุฉ Anti-Patterns ุงูุฃุฏุงุฆูุฉ โ ูุฌุจ ุตูุฑ violations 3. HPOS compatibility โ verified 4. PHPCS WPCS โ pass ุฅุฐุง ูุฌุฏุช violationุ ุฃุนุฏ ูุชุงุจุฉ ุงูููุฏ ูุจู ุงูุชุณููู .
๐ Few-Shot Examples โ ุงูุฃู ุซูุฉ ุงูู ูุฌููุฉ
๐ฏ ุงููุงุนุฏุฉ:
ุจุฏูุงู ู ู ุดุฑุญ ู ุง ุชุฑูุฏุ ุฃุฑู AI ู ุซุงูุงู ูุงุญุฏุงู ู ุซุงููุงู.
๐ ูุงูุจ Few-Shot:
markdown
## Example of Expected Quality
### Input Pattern:
ููุงุณ ููุฑุฃ ู
ู custom table
### Expected Output Pattern:
```php
<?php
declare(strict_types=1);
namespace MyPlugin\Repository;
use MyPlugin\Contract\Repository_Interface;
defined('ABSPATH') || exit;
/**
* Handles persistence for wholesale pricing rules.
*
* @since 1.0.0
*/
final class Pricing_Rule_Repository implements Repository_Interface {
private const TABLE = 'wholesale_pricing_rules';
private const CACHE_GROUP = 'wholesale_pricing';
private const CACHE_TTL = 3600;
public function __construct(
private readonly \wpdb $db
) {}
/**
* {@inheritDoc}
*/
public function find_by_role(string $role): array {
$cache_key = "rules_{$role}";
$cached = wp_cache_get($cache_key, self::CACHE_GROUP);
if (false !== $cached) {
return $cached;
}
$table = $this->db->prefix . self::TABLE;
$sql = $this->db->prepare(
"SELECT id, role, category_id, discount
FROM {$table}
WHERE role = %s AND is_active = 1
ORDER BY priority ASC",
$role
);
$results = $this->db->get_results($sql, ARRAY_A) ?: [];
wp_cache_set($cache_key, $results, self::CACHE_GROUP, self::CACHE_TTL);
return $results;
}
}
Now apply this exact quality level to: [ู ูู ุชู]
text
**ูุฐุง ุงูุฃุณููุจ ูุฑูุน ุงูุฌูุฏุฉ 3-5x** ูุฃูู ูุซุจูุช ุงูู baseline. --- ## 1๏ธโฃ1๏ธโฃ Context Compression โ ุถุบุท ุงูุณูุงู ุจุฐูุงุก ### ๐ฏ ุงูู ุดููุฉ: Prompts ุงูุทูููุฉ ุชูููุฏ AI ุงูุชุฑููุฒ. ุงูุญู: **ุถุบุท ู ูุธู **. ### ๐ ุชูููุงุช ุงูุถุบุท: #### A) Reference Notation (ุจุฏูุงู ู ู ุงูุดุฑุญ) ```markdown ุจุฏูุงู ู ู: "ุงุณุชุฎุฏู ุงูุฃู ุงู ุงููุงู ู ู ุน nonces ู sanitization ู escaping..." ุงูุชุจ: "Apply SEC-STD-1 (ุฑุงุฌุน ูุณู Standards)"
B) Diagram over Description
text
โ "ุงูู
ุณุชุฎุฏู
ูุถุบุท ุฒุฑุ ููุฑุณู AJAXุ ูุชุญูู nonceุ ูุนุงูุฌุ ูุนูุฏ JSON"
โ
User โ [Click] โ AJAX โ {nonce_check} โ Process โ JSON โ UI Update
C) Structured YAML over Prose
yaml
plugin: name: Wholesale Pricing prefix: wp_ text_domain: wholesale-pricing namespace: WP\\WholesalePricing php_min: "8.2" hpso_compat: true
D) Code Skeleton over Specs
php
// ุฃุนุทู AI ูููู ูุงุฑุบ ูู
ูุคู ุจุฏูุงู ู
ู ุดุฑุญ:
final class Calculator {
public function __construct(
private Price_Repository $repo,
private Rules_Engine $engine,
) {}
public function calculate(int $pid, int $uid): float { /* ... */ }
}
1๏ธโฃ2๏ธโฃ Guardrails โ ุญูุงุฌุฒ ุงูุฃู ุงู ูู ุงูุฅุฎุฑุงุฌ
๐ฏ ุงูููุฑุฉ:
AI ูุฏ ููุญุฑู. Guardrails ุชูุฌุจุฑู ุนูู ุงูุจูุงุก ูู ุงูู ุณุงุฑ.
๐ ูุงูุจ Guardrails:
markdown
## Guardrails (ุฅูุฒุงู
ูุฉ)
### ๐ซ Hard Stops (ุชููู ููุฑู ุฅุฐุง):
- ุงูู
ุทููุจ ูุฎุงูู WPCS
- ุงูู
ุทููุจ ููุณุฑ HPOS
- ุงูู
ุทููุจ ูุชุทูุจ ุชุนุฏูู core
- ุงูู
ุทููุจ ูุณุชุฎุฏู
deprecated functions
- ุงูู
ุทููุจ ูุง ูู
ูู ุงุฎุชุจุงุฑู
ูู ูุฐู ุงูุญุงูุงุช: **ุงุฑูุถ ูุงูุชุฑุญ ุจุฏููุงู ุขู
ูุงู**.
### โ ๏ธ Soft Warnings (ูุจู ููู ุฃูู
ู):
- ุงูู
ูู
ุฉ ุชุชุทูุจ > 5 files (ุงูุชุฑุญ ุชูุณูู
)
- Class size > 300 lines (ุงูุชุฑุญ refactor)
- Query time estimate > 100ms (ุงูุชุฑุญ caching)
### โ
Sanity Checks (ุชุญูู ุชููุงุฆู):
- [ ] ูู ู
ูู PHP ูุจุฏุฃ ุจู `<?php` + declare strict_types
- [ ] ูู ู
ูู ููู `defined('ABSPATH') || exit;`
- [ ] ูู output escaped
- [ ] ูู input sanitized
- [ ] ูู query prepared
- [ ] ูู hook ูู priority ู
ุญุฏุฏ
- [ ] ูู method ูู return type
1๏ธโฃ3๏ธโฃ Self-Correction Loop โ ุญููุฉ ุงูุชุตุญูุญ ุงูุฐุงุชู
๐ฏ ุงูููุฑุฉ ุงูุซูุฑูุฉ:
ุงุทูุจ ู ู AI ุฃู ูุฑุงุฌุน ููุณู ูุจู ุงูุชุณููู .
๐ ูุงูุจ Self-Correction:
markdown
## Before Delivering, Run This Self-Review ### Pass 1: Security Audit ุฑุงุฌุน ูู ุณุทุฑ ููุฑุฃ input ุฃู ููุชุจ output: - [ ] ูู ููุงู nonceุ - [ ] ูู ููุงู capability checkุ - [ ] ูู ููุงู sanitizationุ - [ ] ูู ููุงู escapingุ - [ ] ูู ููุงู prepared statementุ **ุฅุฐุง ูุฌุฏุช ุซุบุฑุฉ โ ุฃุนุฏ ุงููุชุงุจุฉ ูุงุฐูุฑ ุงูุซุบุฑุฉ ูู ุงูุชูุฑูุฑ.** ### Pass 2: Performance Audit - [ ] ูู ููุงู queries ุฏุงุฎู loopsุ - [ ] ูู ุงููุชุงุฆุฌ cachedุ - [ ] ูู ุงูุณูุฑุจุชุงุช conditionalุ - [ ] ูู ููุงู index ุนูู ูู WHEREุ ### Pass 3: Compatibility Audit - [ ] ูู ูุนู ู ู ุน HPOSุ - [ ] ูู ูุนู ู ู ุน Blocksุ - [ ] ูู ูุนู ู ู ุน PHP 8.2 strictุ ### Pass 4: Standards Audit - [ ] PHPCS pass (ุงุฐูุฑ ุงูุฃุฎุทุงุก ุงูู ูุตููุญุฉ) - [ ] PHPDoc ูุงู ู - [ ] i18n ูุงู ู ### Pass 5: Tests - [ ] ูู method ุนุงู ูู test - [ ] Coverage โฅ 80% ### Final Report Format:
โ
Passed: X
โ ๏ธ Warnings: Y
โ Fixed: Z (ุงุฐูุฑูุง)
Remaining Risks:
- …
text
--- ## 1๏ธโฃ4๏ธโฃ Advanced Prompting Techniques ### A) Chain-of-Thought (CoT)
“ูุจู ูุชุงุจุฉ ุงูููุฏุ ุงุดุฑุญ ุฎุทูุฉ ุจุฎุทูุฉ:
- ููู ุณุชูุนุฑูู ุงูู interfaceุ
- ููู ุณุชุญู ู ุดููุฉ cachingุ
- ููู ุณุชุชุนุงู ู ู ุน HPOSุ
- ู ุง ุงูู edge casesุ”
text
**ุงููุงุฆุฏุฉ:** AI ูููุฑ ุฃููุงูุ ูุฎุทุฆ ุฃูู. ### B) Tree-of-Thought (ToT)
“ุงูุชุฑุญ 3 ุญููู ู ุนู ุงุฑูุฉ ู ุฎุชููุฉ:
- ุงูุญู A: [ููุฌ] โ ุงูู ุฒุงูุง/ุงูุนููุจ
- ุงูุญู B: [ููุฌ] โ ุงูู ุฒุงูุง/ุงูุนููุจ
- ุงูุญู C: [ููุฌ] โ ุงูู ุฒุงูุง/ุงูุนููุจ
ุซู ุงุฎุชุฑ ุงูุฃูุถู ุจูุงุกู ุนูู [ู ุนูุงุฑ ู ุญุฏุฏ].”
text
**ุงููุงุฆุฏุฉ:** ุญููู ู ุจุชูุฑุฉุ ููุณ ุฃูู ููุฑุฉ. ### C) ReAct (Reason + Act)
“ูุฑุฑ ูุฐู ุงูุญููุฉ:
- Think: ู ุงุฐุง ุฃุญุชุงุฌ ุงูุขูุ
- Act: ูููุฐ ุงูุฎุทูุฉ
- Observe: ุชุญูู ู ู ุงููุชูุฌุฉ
- Continue until done.”
text
**ุงููุงุฆุฏุฉ:** ุญู ู ุดุงูู ู ุนูุฏุฉุ ููุณ ููุท ูุชุงุจุฉ ููุฏ. ### D) Reflexion
“ุจุนุฏ ูุชุงุจุฉ ุงูููุฏ:
- ุงุฎุชุจุฑ ุฐูููุงู ุณููุงุฑูู [edge case]
- ู ุง ุงูุฐู ูุฏ ููุดูุ
- ุฃุนุฏ ุงููุชุงุจุฉ ุจูุงุกู ุนูู ู ุง ุชุนูู ุชู.”
text
**ุงููุงุฆุฏุฉ:** ุฌูุฏุฉ ุฃุนูู ุจุฏูู ุชุฏุฎู ุจุดุฑู. --- ## 1๏ธโฃ5๏ธโฃ Production-Ready Checklist ุงููุงู ูุฉ ### ๐ ู ุง ูุจู ุงูุชุณููู ุงูููุงุฆู: ```markdown ## ๐ Security - [ ] Nonces ุนูู ูู form/AJAX - [ ] Capability checks ุนูู ูู action - [ ] Sanitization ุนูู ูู input - [ ] Escaping ุนูู ูู output - [ ] Prepared statements ุนูู ูู query - [ ] No direct file access (ABSPATH check) - [ ] No file upload ุจุฏูู validation ## โก Performance - [ ] No N+1 queries - [ ] Transients/Object Cache ููู expensive ops - [ ] Conditional asset loading - [ ] Action Scheduler ููู background jobs - [ ] Indexes ุนูู custom tables - [ ] Query time < 100ms - [ ] Memory usage < 128MB ## ๐๏ธ Architecture - [ ] SOLID principles - [ ] Dependency Injection - [ ] Single Responsibility per class - [ ] Interface-based contracts - [ ] No God classes - [ ] Namespaced code - [ ] PSR-4 autoloading ## ๐ Compatibility - [ ] HPOS verified - [ ] WC Blocks tested - [ ] WPML/Polylang ready - [ ] Multisite compatible (ุฅู ูุฒู ) - [ ] PHP 8.2+ strict types - [ ] No deprecated functions - [ ] Cache plugins compatible ## ๐ Standards - [ ] PSR-12 pass - [ ] WPCS pass (0 errors) - [ ] PHPDoc complete - [ ] i18n (__(), _e(), _n()) - [ ] Text domain consistent - [ ] .pot file generated ## ๐งช Testing - [ ] Unit tests (PHPUnit) - [ ] Integration tests (WP_UnitTestCase) - [ ] Coverage โฅ 80% - [ ] Edge cases covered - [ ] Mock external APIs - [ ] CI pipeline green ## ๐ Documentation - [ ] readme.txt (WP.org format) - [ ] README.md (dev docs) - [ ] CHANGELOG.md - [ ] Inline PHPDoc - [ ] Hook reference doc - [ ] Migration guide (ุฅู ูุฒู ) ## ๐ Deployment - [ ] Version bump - [ ] Activation/deactivation hooks - [ ] Uninstall cleanup - [ ] Migration scripts - [ ] Rollback plan - [ ] Monitoring plan
1๏ธโฃ6๏ธโฃ ุงููุงูุจ ุงูุดุงู ู ุงูููุงุฆู (Master Template)
markdown
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฏ PRODUCTION-GRADE PROMPT TEMPLATE v2.0 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # ๐ญ ROLE ุฃูุช [ุงูุฏูุฑ ุงูู ุญุฏุฏ] ุจุฎุจุฑุฉ [X] ุณูุฉุ ู ุชุฎุตุต ูู [ุงูุชุฎุตุตุงุช]. ุชุนู ู ุจู ุนุงููุฑ [Standards]. ุชููุฑ ูู [Architect/Engineer/Reviewer]. # ๐ CONTEXT ## Technical Environment ```yaml WordPress: 6.5+ WooCommerce: 8.7+ PHP: 8.2 (strict_types=1) MySQL: 8.0 Cache: Redis Server: Nginx HPOS: enabled
Business Context
- ุงูุณูู: [ุนุฑุจู/ุฅูุฌููุฒู/ููุงูู ุง]
- ุงูุญุฌู : [X SKUุ Y order/day]
- ุงูุฌู ููุฑ: [B2B/B2C/ู ุฎุชูุท]
Existing Stack
- Theme: [custom/ุงุณู ]
- Plugins: [ูุงุฆู ุฉ]
- Integrations: [APIs]
๐ TASK
Primary Objective
[ูุฏู ูุงุญุฏ ูุงุถุญ]
Inputs
- [Input 1]
- [Input 2]
Outputs
- [Output 1]
- [Output 2]
Success Criteria
- โก ู ุนูุงุฑ 1 ูุงุจู ููููุงุณ
- โก ู ุนูุงุฑ 2
- โก ู ุนูุงุฑ 3
Out of Scope
- [ู ุง ูู ููุนูู]
๐ STANDARDS (Non-negotiable)
Security: [ุชูุงุตูู]
Standards: PSR-12 + WPCS
Performance: [ุชูุงุตูู]
Testing: PHPUnit โฅ 80%
Compatibility: HPOS, Blocks, WPML
๐ง CONSTRAINTS
- โ ูุง ุชุนุฏูู core/theme
- โ No deprecated functions
- โ PHP 8.2+ only
- โ Hooks ุฑุณู ูุฉ ููุท
๐ซ ANTI-PATTERNS (Must Avoid)
[ูุงุฆู ุฉ ุงูู anti-patterns ุงูู ู ููุนุฉ]
๐ OUTPUT CONTRACT
- ูู ู ูู: declare strict_types + ABSPATH check
- ูู method: type hints + PHPDoc + โค 30 lines
- ูู class: โค 300 lines
- ูุง TODO โ ุงูููุฏ ูุงู ู
- [ุชูุงุตูู ุฅุถุงููุฉ]
๐ SELF-REVIEW (Before Delivery)
- Security Audit โ report violations
- Performance Audit โ report findings
- Compatibility Audit โ verify
- Standards Audit โ PHPCS result
- Tests โ coverage report
๐ก๏ธ GUARDRAILS
Hard Stops (ุงุฑูุถ):
- [ู ุง ูุฌุจ ุฑูุถู]
Soft Warnings (ูุจู):
- [ู ุง ูุฌุจ ุงูุชูุจูู ุนููู]
๐ฆ FORMAT / DELIVERABLES
File Structure
text
[ุดุฌุฑุฉ ุงูู ููุงุช]
Deliverables
- โก ููุฏ ูุงู ู
- โก Tests
- โก Docs
- โก Migration guide
- โก Rollback plan
๐ฌ EXECUTION PLAN
Phase 1: Discovery
[ุชูุงุตูู]
Phase 2: Architecture
[ุชูุงุตูู]
…
Final: Self-Review + Report
[ุชูุงุตูู]
๐ EXAMPLES (Few-Shot)
[ู ุซุงู ุนูู ุงูุฌูุฏุฉ ุงูู ุทููุจุฉ]
โ CLARIFICATIONS
ูุจู ุงูุจุฏุกุ ุงุณุฃููู ุนู ุฃู ุบู ูุถ ูู:
- [ููุทุฉ]
- [ููุทุฉ]
- [ููุทุฉ]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
--- ## 1๏ธโฃ7๏ธโฃ ุณููุงุฑูููุงุช ุฌุงูุฒุฉ (Ready-to-Use Scenarios) ### ๐ฏ ุณุฃุนุทูู ุงูุขู 3 ุณููุงุฑูููุงุช ูุงู ูุฉ: --- ### ๐ฆ ุงูุณููุงุฑูู 1: Custom Shipping Method Plugin ```markdown # ROLE Senior WooCommerce Shipping Engineerุ ุฎุจูุฑ ูู WC_Shipping_Method API ูREST integrations. # CONTEXT - WC 8.7+, PHP 8.2, HPOS enabled - Aramex API v2 ููุชูุตูู - 15 ู ูุทูุฉ ุณุนูุฏูุฉ + ุฏูู ุงูุฎููุฌ - 200 ุทูุจ/ููู # TASK ุจูุงุก shipping method ู ุฎุตุต: - ุญุณุงุจ ุงูุชูููุฉ ุญุณุจ ุงููุฒู + ุงูู ูุทูุฉ + ููู ุฉ ุงูุณูุฉ - ุชุชุจุน ุงูุดุญูุงุช ุนุจุฑ Aramex API - ุนุฑุถ tracking ูู My Account - Webhook ูุชุญุฏูุซ ุงูุญุงูุฉ ุชููุงุฆูุงู # SUCCESS CRITERIA - [ ] Rate calculation < 200ms - [ ] Aramex API failure โ fallback rate - [ ] Webhook idempotent (ูุง ุชูุฑุงุฑ) - [ ] HPOS compatible - [ ] Unit tests โฅ 85% # CONSTRAINTS - ูุง ุชุนุฏูู WC core - ุงุณุชุฎุฏู WC_Shipping_Method ููุท - Action Scheduler ูู ุฒุงู ูุฉ ุงูุญุงูุงุช # DELIVERABLES - Plugin ูุงู ู - Aramex API client (PSR-18) - Admin settings page - Webhook endpoint - Tests + Docs
๐ฐ ุงูุณููุงุฑูู 2: B2B Wholesale Pricing Engine
markdown
# ROLE Senior WooCommerce Engineer ู ุชุฎุตุต ูู dynamic pricing ู performance ูู ู ุดุงุฑูุน 50k+ SKU. # CONTEXT - 50k SKUุ 3 tiers (bronze/silver/gold) - 500 order/dayุ Redis cache - ุชุณุนูุฑ ุญุณุจ: tier + category + quantity + season # TASK Rules Engine ููุชุณุนูุฑ ุงูุฏููุงู ููู: - ููุงุนุฏ ูุงุจูุฉ ููุชุฑููุจ (AND/OR) - Cache invalidation ุฐูู - REST API ููู price preview - Admin UI ูุฅุฏุงุฑุฉ ุงูููุงุนุฏ # SUCCESS CRITERIA - [ ] Price calc < 30ms (cached) - [ ] Cache invalidation ุฏููู (ูุง stale prices) - [ ] 100% HPOS + Blocks compatible - [ ] Coverage โฅ 85% - [ ] Query count < 3 ููู price calc # ARCHITECTURE - Repository pattern ููููุงุนุฏ - Strategy pattern ููู ููุน ูุงุนุฏุฉ - Observer pattern ูู cache invalidation # DELIVERABLES [ุชูุงุตูู ูุงู ูุฉ]
๐ ุงูุณููุงุฑูู 3: REST API Integration ู ุน ERP
markdown
# ROLE Senior WordPress/WooCommerce Engineer ู ุชุฎุตุต ูู REST API design + external integrations + resilience. # CONTEXT - ู ุฒุงู ูุฉ ู ุน ERP (SAP/Odoo) - 10k product sync/hour - bidirectional sync (product + order) - Network unreliable โ resilience ู ุทููุจุฉ # TASK Integration layer ูุงู ู: - Custom REST endpoints (wp-json/erp/v1) - JWT authentication - Rate limiting - Retry logic + exponential backoff - Queue via Action Scheduler - Idempotency keys - Webhook receivers - Sync logs dashboard # SUCCESS CRITERIA - [ ] 0 data loss ูู network failure - [ ] Idempotent operations - [ ] Sync 10k products < 30 min - [ ] JWT + capability + rate limit - [ ] Full audit log - [ ] Rollback capability # ARCHITECTURE - Service layer abstraction - Queue-based processing - Circuit breaker pattern - Dead letter queue # DELIVERABLES [ุชูุงุตูู ูุงู ูุฉ]
1๏ธโฃ8๏ธโฃ ุฌุฏูู ุงูู ูุงุฑูุฉ: Prompt ุนุงุฏู vs ุงุญุชุฑุงูู
| ุงูุจูุนุฏ | Prompt ุนุงุฏู | Prompt ุงุญุชุฑุงูู |
|---|---|---|
| ุงูุทูู | 50-100 ููู ุฉ | 800-2000 ููู ุฉ |
| ุงูุณูุงู | ุนุงู | ุจูุฆุฉ ูุงู ูุฉ + ุฃุฑูุงู |
| Standards | ุบูุฑ ู ุฐููุฑุฉ | ุฅูุฒุงู ูุฉ + ูุงุจูุฉ ููููุงุณ |
| Constraints | ูุง ุดูุก | ูุงุถุญุฉ + ุตุฑูุญุฉ |
| Output | ููุฏ ููุท | ููุฏ + tests + docs + report |
| Quality | Toy | Production-ready |
| Security | ุบุงูุจุงู ุซุบุฑุงุช | ู ูุฑุงุฌูุน + ู ูุฎุชุจุฑ |
| Performance | ุนุดูุงุฆู | benchmarked |
| Time to production | ุฃุณุงุจูุน (refactor) | ุฃูุงู (deploy) |
1๏ธโฃ9๏ธโฃ ููุงุณ ุฌูุฏุฉ Prompt โ Scorecard
๐ ูููู Promptู ู ู 100:
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโ โ ุงูุจูุนุฏ โ ุงูููุงุท โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโค โ 1. Role ู ุญุฏุฏ ุจูุถูุญ โ 10 โ โ 2. Context ุชููู ูุงู ู โ 15 โ โ 3. Task ูุงุจูุฉ ููููุงุณ (SMART) โ 15 โ โ 4. Standards ุตุฑูุญุฉ โ 10 โ โ 5. Anti-patterns ู ุญุธูุฑุฉ โ 10 โ โ 6. Output Contract ูุงุถุญ โ 10 โ โ 7. Self-Review ู ุทููุจ โ 10 โ โ 8. Few-Shot Example โ 10 โ โ 9. Deliverables ู ุญุฏุฏุฉ โ 5 โ โ 10. Phases ู ููุณูู ุฉ โ 5 โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโค โ ุงูู ุฌู ูุน โ 100 โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโ < 60 โ prompt ูุงูู 60-80 โ prompt ุฌูุฏ 80-95 โ prompt ุงุญุชุฑุงูู 95+ โ prompt ุฅูุชุงุฌู ู ุคุณุณู
2๏ธโฃ0๏ธโฃ ููู ุฉ ุฃุฎูุฑุฉ: ุงูุนูููุฉ ุงูุตุญูุญุฉ
๐ง ุงููุฑู ุจูู ูุงูู ูู ููุฏุณ:
| ุงููุงูู | ุงูู ููุฏุณ |
|---|---|
| “ุงูุชุจ ูู ููุฏ” | “ุงุจูู ูู ูุธุงู ุงู” |
| ูุจุฏุฃ ุจุงูููุฏ | ูุจุฏุฃ ุจุงูุณูุงู |
| ูุนู ู ุซู ูุตูุญ | ูุฎุทุท ุซู ูููุฐ |
| ูููุณ ุจุงูู ุธูุฑ | ูููุณ ุจุงูู metrics |
| ูุณุชุณูู ุนูุฏ ุงูุฎุทุฃ | ูุจูู resilience |
| ููุชุจ prompt | ูุจูู prompt architecture |
๐ ุงููุงุนุฏุฉ ุงูุฐูุจูุฉ:
“AI ููุณุช ุจุฏููุงู ุนู ุงูู ููุฏุณ โ ุฅููุง ู ุถุงุนู ููุฉ ููู ููุฏุณ.
Prompt ุณูุก + AI = ููุฏ ุณูุก ุฃุณุฑุน.
Prompt ุงุญุชุฑุงูู + AI = ูุฑูู ูุงู ู.”
๐ฏ ูู ูุทุจูู ุงูุขูุ
ุงุฎุชุฑ ูุงุญุฏุฉ ูุณุฃุตูุบ ูู Prompt ุฅูุชุงุฌู ูุงู ู ู ู ุงูุตูุฑ:
- ๐ Custom Shipping Method ู ุน Aramex/DHL API
- ๐ฐ B2B Tiered Pricing Engine ููุงุนุฏุฉ 50k SKU
- ๐ ERP Integration Layer ู ุน idempotency + queue
- ๐ Custom Reports Dashboard ููุฃุฏู ู
- ๐จ Custom Checkout Flow ู ุชุนุฏุฏ ุงูุฎุทูุงุช
- ๐ JWT Authentication ูู REST API
- ๐๏ธ Migration ุฅูู HPOS ูู plugin ูุฏูู
ูู ูู ุงูุฑูู + ุฃู ุชูุงุตูู ุนู ุจูุฆุชูุ ูุณุฃุนุทูู Prompt ุฌุงูุฒ ููุฅูุชุงุฌ. ๐
Prompt Engineering ุงูุงุญุชุฑุงูู ูู ุดุงุฑูุน PHP/WordPress/WooCommerce ุงูุฅูุชุงุฌูุฉ
๐ฏ ุงูููุณูุฉ ุงูุฃุณุงุณูุฉ
text
ุงูููุฏ ุงูุฌูุฏ ูุง ูููุชุจ ุจุงูุตุฏูุฉุ ุจู ููููุฏุณ ุจุงูุณูุงู ุงูุตุญูุญ.
ู ุนุธู ุงูู ุทูุฑูู ููุดููู ู ุน AI ูุฃููู ููุชุจูู ุฃูุงู ุฑ ุจุฏูุงู ู ู ุณูุงู ููุฏุณู ูุงู ู. ุงููุฑู ุจูู prompt ููุชุฌ demo ูprompt ููุชุฌ production code ูู ูู ูุฉ ุงููููุฏ (Constraints) ููุถูุญ ุงูู ุนู ุงุฑูุฉ.
๐๏ธ ุงููููู ุงูุฎู ุงุณู ูุฃู Prompt ุงุญุชุฑุงูู
1๏ธโฃ Role Definition โ ุชุนุฑูู ุงูุฏูุฑ
2๏ธโฃ Context Injection โ ุญูู ุงูุณูุงู ุงูุชููู
3๏ธโฃ Task Specification โ ุชุญุฏูุฏ ุงูู ูู ุฉ ุจุฏูุฉ
4๏ธโฃ Constraints & Standards โ ุงููููุฏ ูุงูู ุนุงููุฑ
5๏ธโฃ Output Contract โ ุนูุฏ ุงูู ุฎุฑุฌุงุช
๐ ุงููุงูุจ ุงูุงุญุชุฑุงูู ุงููุงู ู
markdown
# ROLE
ุฃูุช Senior PHP/WordPress Engineer ุจุฎุจุฑุฉ 15+ ุณูุฉุ ู
ุชุฎุตุต ูู:
- WordPress Plugin/Theme Development ุจู
ุนุงููุฑ PSR-12 ู WP Coding Standards
- WooCommerce Custom Extensions ู HPOS Compatibility
- Performance Optimization (Query Optimization, Caching, Transients)
- Security Hardening (Nonces, Capability Checks, Sanitization, Escaping)
- Testing (PHPUnit, WP_Mock, Brain Monkey)
# PROJECT CONTEXT
- **Stack**: PHP 8.2 | WordPress 6.5+ | WooCommerce 9.x | MySQL 8.0
- **Architecture**: [Plugin/Theme/Mu-plugin] โ ุจููุฉ MVC ู
ุน Service Container
- **Multisite**: [Yes/No]
- **HPOS**: [Enabled/Disabled] โ WooCommerce High-Performance Order Storage
- **Caching Layer**: Redis Object Cache + Transients API
- **Code Standards**: WordPress Coding Standards + PSR-4 Autoloading
- **PHP Version Constraint**: ุนุฏู
ุงุณุชุฎุฏุงู
deprecated functions ูุจู 8.0
# TASK
[ูุตู ุฏููู ููู
ูู
ุฉ โ ู
ุงุฐุง ูุจูู ุจุงูุชุญุฏูุฏ]
# DETAILED REQUIREMENTS
1. **Functional**:
- [ุงูู
ุชุทูุจ 1]
- [ุงูู
ุชุทูุจ 2]
2. **Non-Functional**:
- Performance: ุงูุงุณุชุนูุงู
ุงุช ูุฌุจ ุฃู ุชููู < 50ms
- Security: ูู input ููุนูููู
ุ ูู output ูููุฑููุจ
- Scalability: ูุฏุนู
100K+ ุณุฌู ุจุฏูู ุชุฃุซูุฑ
- i18n: ุฌู
ูุน ุงููุตูุต ูุงุจูุฉ ููุชุฑุฌู
ุฉ (text-domain ู
ุญุฏุฏ)
3. **Compatibility**:
- WordPress Multisite
- HPOS (WooCommerce)
- PHP 8.0 โ 8.3
- Classic + Block Themes
# ARCHITECTURAL CONSTRAINTS
- **Pattern**: Repository Pattern ููู Data Access
- **DI**: Constructor Injection โ ุจุฏูู Service Locator
- **Hooks**: ุงุณุชุฎุฏุงู
Actions/Filters ุจุฃุณู
ุงุก prefixed ุจู `{plugin_slug}_`
- **File Structure**:
plugin-name/
โโโ src/
โ โโโ Admin/
โ โโโ Frontend/
โ โโโ Domain/
โ โโโ Infrastructure/
โ โโโ Application/
โโโ tests/
โโโ composer.json
โโโ plugin-name.php
text
# CODING STANDARDS (MANDATORY)
โ
**DO**:
- `declare(strict_types=1);` ูู ูู ู
ูู PHP
- Return types + Parameter types (PHP 8 syntax)
- `wpdb->prepare()` ููู ุงุณุชุนูุงู
ุฏููุงู
ููู
- `current_user_can()` ูุจู ูู ุนู
ููุฉ ุญุณุงุณุฉ
- `wp_verify_nonce()` ููู form submission
- `esc_html()`, `esc_attr()`, `esc_url()`, `wp_kses_post()`
- `sanitize_text_field()`, `absint()`, `wp_unslash()`
- Namespaces + PSR-4 autoloading
- DocBlocks ูุงู
ูุฉ ููู method
โ **DON'T**:
- ูุง `query_posts()` โ ุงุณุชุฎุฏู
`WP_Query`
- ูุง `extract()` ุฃู `eval()`
- ูุง SQL concatenation ู
ุจุงุดุฑ
- ูุง global variables
- ูุง deprecated functions (ู
ุซู `get_bloginfo('url')` โ `home_url()`)
- ูุง `@` error suppression
# OUTPUT FORMAT
1. Architecture Overview
[ู ุฎุทุท ู ุฎุชุตุฑ ููุจููุฉ]
2. File Tree
[ุดุฌุฑุฉ ุงูู ููุงุช]
3. Code Files
File: src/path/to/File.php
php
<?php // ุงูููุฏ ุงููุงู ู
4. Installation & Usage
[ุฎุทูุงุช ุงูุชูุตูุจ]
5. Testing Strategy
[ููููุฉ ุงุฎุชุจุงุฑ ุงูููุฏ]
6. Edge Cases Handled
[ุงูุญุงูุงุช ุงูุญุฏูุฉ ุงูุชู ุชู ุช ู ุนุงูุฌุชูุง]
7. Performance Notes
[ู ูุงุญุธุงุช ุงูุฃุฏุงุก]
text
# QUALITY GATES ูุจู ุชุณููู ุงูููุฏุ ุชุญูู ู ู: - [ ] ูู ุงุณุชุนูุงู ูุณุชุฎุฏู `$wpdb->prepare()` ุฃู WP_Query - [ ] ูู capability check ู ูุฌูุฏ - [ ] ูู nonce ู ูุฌูุฏ - [ ] ูู output ู ููุฑููุจ - [ ] ูู input ู ูุนูููู - [ ] strict_types ู ูุนูู - [ ] DocBlocks ูุงู ูุฉ - [ ] Translation-ready - [ ] Multisite-safe - [ ] HPOS-compatible (ุฅู ูุงู WooCommerce) # QUESTIONS TO CLARIFY (ุงุณุฃู ูุจู ุงูุจุฏุก) ุฅุฐุง ูุงู ุฃู ู ุชุทูุจ ุบุงู ุถุงูุ ุงุณุฃู ูุจู ูุชุงุจุฉ ุงูููุฏ: 1. ... 2. ...
๐ฅ ู ุซุงู ุชุทุจููู โ WooCommerce Custom Shipping Method
markdown
# ROLE
ุฃูุช Senior WooCommerce Engineer ู
ุชุฎุตุต ูู Shipping API ู HPOS.
# CONTEXT
- WooCommerce 9.2, WordPress 6.6, PHP 8.2
- HPOS Enabled
- Multisite: Yes (2 sites)
- Store ูุฏุนู
: Saudi Arabia (SAR), UAE (AED)
- Uses: WooCommerce Blocks + Classic Checkout
# TASK
ุฃูุดุฆ Custom Shipping Method ุจุนููุงู "Free Shipping over 500 SAR"
ูุญุณุจ ุจูุงุกู ุนูู subtotal ููุท (ุจุฏูู tax)ุ ููุนู
ู ู
ุน:
- Cart Block
- Checkout Block
- Classic Shortcodes
- HPOS Orders
# REQUIREMENTS
1. Shipping method ุชุธูุฑ ููุท ุนูุฏ ุชุฌุงูุฒ 500 SAR
2. Label ุฏููุงู
ููู: "Free Shipping โ ูููุฑุช {amount} SAR"
3. ูุฌุจ ุฃู ูุฏุนู
Multisite (settings ููู site)
4. Caching: shipping rates cached 1 hour via transient
5. HPOS: ูุชูุงูู ู
ุน `wc_get_orders()` ุงูุฌุฏูุฏุฉ
# CONSTRAINTS
- Extend `WC_Shipping_Method`
- ุงุณุชุฎุฏู
`woocommerce_shipping_methods` filter
- ูู ุงููุตูุต ูู text-domain `zezo-free-shipping`
- ูุง ุชุนุชู
ุฏ ุนูู cart session ูู ุญุณุงุจ rates (ุงุณุชุฎุฏู
package data)
# OUTPUT
ููุฏ ูุงู
ู ูู ู
ูู ูุงุญุฏ + ุดุฑุญ ููููุฉ ุงูุชุณุฌูู + Hook names
๐ก ุฃุณุฑุงุฑ ุงุญุชุฑุงููุฉ ุฅุถุงููุฉ
๐น 1. ุชูููุฉ “Chain of Thought ุงูู ููุฏูุณ”
ุจุฏูุงู ู ู ุทูุจ ููุฏ ู ุจุงุดุฑุฉุ ุงุทูุจ:
“ูููุฑ ุจุตูุช ุนุงูู ูู 3 ุฎุทูุงุช: (1) ุชุญููู ุงูู ุชุทูุจุงุชุ (2) ุงุฎุชูุงุฑ ุงูู ุนู ุงุฑูุฉุ (3) ูุชุงุจุฉ ุงูููุฏ. ูุง ุชูุชุจ ููุฏ ูู ุงูุฎุทูุชูู 1 ู 2.”
๐น 2. ุชูููุฉ “Red Team First”
“ูุจู ูุชุงุจุฉ ุงูููุฏุ ุงุฐูุฑ 5 ุทุฑู ูู ูู ุฃู ููุดู ุจูุง ูุฐุง ุงูุญูุ ุซู ุงูุชุจ ููุฏุงู ูุชุฌูุจูุง.”
๐น 3. ุชูููุฉ “Diff-Based Iteration”
ุนูุฏ ุงูุชุนุฏูู:
“ุฃุนุทูู diff ููุท (unified format) ุจูู ุงููุณุฎุฉ ุงูุณุงุจูุฉ ูุงูุฌุฏูุฏุฉุ ู ุน ุณุจุจ ูู ุชุบููุฑ.”
๐น 4. Context Window Management
ููู tasks ุงููุจูุฑุฉุ ูุณูู ุฅูู ู ุฑุงุญู:
text
Phase 1: Database Schema Phase 2: Repository Layer Phase 3: Business Logic Phase 4: Presentation Layer Phase 5: Tests
ูู Phase ูู prompt ู ููุตู ู ุน “Context Carry-over” (ุชูุฎูุต ู ุง ุชู ).
๐น 5. Anti-Hallucination Guards
ุฃุถู ุฏุงุฆู ุงู:
“ุฅุฐุง ูู ุชูู ู ุชุฃูุฏุงู ู ู API ุฃู function ู ูุฌูุฏุฉ ูู ุฅุตุฏุงุฑ WordPress/WooCommerce ุงูู ุญุฏุฏุ ูู ‘ุบูุฑ ู ุชุฃูุฏ’ ุจุฏูุงู ู ู ุงุฎุชูุงู ููุฏ. ุชุญูู ู ู
@sinceูู documentation.”
๐ ู ุตูููุฉ ุงููููุฏ ุญุณุจ ููุน ุงูู ุดุฑูุน
| ููุน ุงูู ุดุฑูุน | Constraints ุฅูุฒุงู ูุฉ ุฅุถุงููุฉ |
|---|---|
| Plugin | Activation/Deactivation hooks, Uninstall cleanup, i18n |
| Theme | Template hierarchy, wp_enqueue_*, theme_support |
| WooCommerce Add-on | HPOS, Blocks compat, wc_* functions, CRUD |
| REST API | register_rest_route, permission_callback, schema |
| Gutenberg Block | block.json, @wordpress/scripts, SSR |
| Headless/API | JWT/OAuth, rate limiting, CORS |
โก Checklist ุงูููุงุฆู ูุจู ุฅุฑุณุงู ุฃู Prompt
text
[ ] ุญุฏุฏุช Role + ุณููุงุช ุงูุฎุจุฑุฉ + ุงูุชุฎุตุต [ ] ุญููุช: PHP/WP/WC versions [ ] ุญุฏุฏุช: Architecture pattern [ ] ุฃุถูุช: HPOS/Multisite/Cache constraints [ ] ูุชุจุช: Output format ุจุดูู ูุงุถุญ [ ] ุฃุถูุช: Quality gates checklist [ ] ุทูุจุช: ุงูุฃุณุฆูุฉ ุงูุชูุถูุญูุฉ ูุจู ุงูููุฏ [ ] ุญุฏุฏุช: text-domain ู namespaces
๐ ุงููุชูุฌุฉ ุงูู ุชููุนุฉ
ุจูุฐุง ุงูุฅุทุงุฑุ ุณุชุญุตู ุนูู:
- ููุฏ ุฅูุชุงุฌู ูุนูู ูุนู ู ู ุจุงุดุฑุฉ ุจุนุฏ ุงูู ุฑุงุฌุนุฉ
- ู ุชูุงูู ู ุน ุงูุจูุฆุงุช ุงูุญุฏูุซุฉ (HPOS, PHP 8.2, Blocks)
- ุขู ู ููู OWASP + WP Security Best Practices
- ูุงุจู ููุชูุณุน ุจุฏูู ุฅุนุงุฏุฉ ูุชุงุจุฉ
- ู ูุซูู ุจู ุนุงููุฑ Enterprise
๐ฌ ู ูุงุญุธุฉ ุฃุฎูุฑุฉ: ุงูู Prompt ุงูุฌูุฏ ูุดุจู Ticket ูู Jira ูุชุจู ู ููุฏุณ ู ุนู ุงุฑู โ ูู ุงูุชูุงุตูู ู ูุฌูุฏุฉุ ูุง ู ุฌุงู ููุงูุชุฑุงุถุงุชุ ูุงูู ุฎุฑุฌุงุช ู ุญุฏุฏุฉ ู ุณุจูุงู.
ูู ุชุฑูุฏ ุฃู ุฃุนุทูู ูุณุฎุฉ ู ุชุฎุตุตุฉ ู ู ูุฐุง ุงูุฅุทุงุฑ ูุฃุญุฏ ุงูุณููุงุฑูููุงุช ุงูุชุงููุฉุ
- WooCommerce HPOS Migration
- Custom Gutenberg Block with Dynamic Data
- REST API Endpoint for Mobile App
- WordPress Multisite SaaS Platform
ุงูุฅุทุงุฑ ุงูู ูุณูุน โ Deep Dive ูู Prompt Engineering ููู ุดุงุฑูุน ุงูุฅูุชุงุฌูุฉ
๐ง ุงูุฌุฒุก ุงูุฃูู: ุนูู ุงูููุณ ุงูููุฏุณู ูุฑุงุก ุงูู Prompt
ูู ุงุฐุง ุชูุดู Prompts ุงูู ุทูุฑููุ
| ุงูุณุจุจ | ุงููุชูุฌุฉ | ุงูุญู |
|---|---|---|
| Ambiguity (ุบู ูุถ) | ููุฏ ุนุงู ูุง ููุจู ุงูุญุงุฌุฉ | ุชุญุฏูุฏ ุฏููู ููู ุฎุฑุฌุงุช |
| Missing Context | API ู ุฎุชูู ุฃู deprecated | ุญูู ุงูุฅุตุฏุงุฑุงุช ูุงูู stack |
| No Constraints | ููุฏ demo ูููุณ production | ูููุฏ ุตุฑูุญุฉ ุฅูุฒุงู ูุฉ |
| Unclear Success | ูุง ู ุนูุงุฑ ููุฌูุฏุฉ | Quality Gates + Acceptance Criteria |
| Single-Shot | ูุชูุฌุฉ ุณุทุญูุฉ | Chain-of-Thought + Iteration |
ุงูู ุณุชููุงุช ุงูุฎู ุณุฉ ููุถุฌ ุงูู Prompt
text
L1: "ุงูุชุจ ูู plugin ููุฑุฏุจุฑูุณ" โ Demo L2: "ุงูุชุจ plugin ูุฅุฏุงุฑุฉ ุงูุนู ูุงุก" โ Skeleton L3: "ุงูุชุจ plugin ุจู MVC ู PSR-4" โ Functional L4: "+ constraints ุฃู ููุฉ ูุฃุฏุงุก" โ Production L5: "+ ู ุนู ุงุฑูุฉ + tests + docs" โ Enterprise โญ
๐๏ธ ุงูุฌุฒุก ุงูุซุงูู: ุงูููุงูุจ ุงูู ุชุฎุตุตุฉ (7 ุณููุงุฑูููุงุช)
๐ท ุงููุงูุจ 1: WooCommerce HPOS Migration
markdown
# ROLE
Senior WooCommerce Engineer ู
ุชุฎุตุต ูู HPOS Migration ู Data Integrity.
# CONTEXT
- WooCommerce 9.x ู
ุน HPOS ู
ููุนููู
- ู
ุดุฑูุน ู
ูุฌูุฏ ูุณุชุฎุฏู
postmeta ู
ุจุงุดุฑุฉ (`get_post_meta($order_id, '_billing_email')`)
- 250,000+ order ูู production
- Zero-downtime migration ู
ุทููุจุฉ
# TASK
ุญููู ุงูููุฏ ุงููุฏูู
ููุชูุงูู ู
ุน HPOS **ู
ุน ุงูุญูุงุธ ุนูู backward compatibility**.
# ANTI-PATTERNS TO FIX
โ `get_post_meta($order_id, '_order_total', true)`
โ `update_post_meta($order_id, 'custom_field', $value)`
โ `get_posts(['post_type' => 'shop_order'])`
โ `wp_query` ุนูู `shop_order`
# CORRECT PATTERNS
โ
`$order = wc_get_order($order_id); $order->get_total();`
โ
`$order->update_meta_data('custom_field', $value); $order->save();`
โ
`wc_get_orders(['limit' => -1, 'status' => 'completed'])`
โ
ุงุณุชุฎุฏุงู
`OrderUtil::custom_orders_table_usage_is_enabled()`
# CONSTRAINTS
- ูู ุงุณุชุฏุนุงุก ูุฌุจ ุฃู ูุนู
ู ูู **ุงููุถุนูู** (HPOS ON/OFF)
- ุงุณุชุฎุฏู
`FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__)`
- ูุง ุชุณุชุฎุฏู
`$wpdb` ู
ุจุงุดุฑุฉ ุนูู `wp_posts` ููู orders
- Migration script ูุฌุจ ุฃู ูููู **idempotent** ู **batched** (500 order/ุฏูุนุฉ)
# OUTPUT
1. Declaration of compatibility (ูู `before_woocommerce_init`)
2. Before/After code comparison ููู pattern
3. Migration script ุจู batch processing + progress logging
4. Rollback strategy
5. Testing checklist
๐ท ุงููุงูุจ 2: Gutenberg Block ู ุชูุฏู ู ุน Dynamic Data
markdown
# ROLE Senior WordPress Block Developer โ ุฎุจุฑุฉ ู ุน block.json, ServerSideRender, Interactivity API. # CONTEXT - WordPress 6.6+, Node 20+, @wordpress/scripts 27.x - Block Theme (FSE) + Classic Theme compatibility - PHP 8.2 / React 18 / TypeScript 5.x - Multi-language (WPML compatible) # TASK ุฃูุดุฆ Custom Block: "ุฃุญุฏุซ ุงูู ูุงูุงุช ุญุณุจ ุงููุฆุฉ" ู ุน: - Server-side rendering (dynamic block) - Block Bindings API ููุฑุจุท ุจุงูู ูุชุง - Interactivity API ููู filtering ุจุฏูู reload - Block Variations (Grid / List / Carousel) - Block Patterns ู ุณุฌููุฉ ู ุณุจูุงู # ARCHITECTURE
my-block/
โโโ block.json
โโโ src/
โ โโโ index.ts
โ โโโ edit.tsx
โ โโโ save.tsx (null ููู dynamic)
โ โโโ variations.ts
โ โโโ hooks/
โ โ โโโ usePosts.ts
โ โโโ components/
โโโ render.php (Server-side)
โโโ view.ts (Interactivity API)
โโโ build/
text
# CONSTRAINTS - `block.json` ู ุน `"apiVersion": 3` - ุงุณุชุฎุฏู `useSelect` + `@wordpress/data` โ ูุง fetch ู ุจุงุดุฑ - SSR ุนุจุฑ `render_callback` ูู PHP โ ูุง `ServerSideRender` component - `viewScriptModule` ููู Interactivity API - Sanitize ูู attribute ูู `render.php` - Cache: `wp_cache_get/set` ู ุน group `my_block_posts` # OUTPUT FORMAT
block.json ุงููุงู ู
edit.tsx ู ุน InspectorControls
render.php ู ุน caching + escaping
view.ts ููู Interactivity
registration ูู PHP (register_block_type)
Performance notes (query optimization)
text
# QUALITY GATES - [ ] ูุนู ู ู ุน FSE ู Classic Themes - [ ] Core Web Vitals ู ุญุณููุฉ (LCP < 2.5s) - [ ] Lazy loading ููุตูุฑ - [ ] ูุง queries ูู render ููู block (caching) - [ ] Escaping ูุงู ู - [ ] Translation-ready
๐ท ุงููุงูุจ 3: REST API Endpoint ูุชุทุจูู ู ูุจุงูู
markdown
# ROLE
Senior WordPress API Engineer โ ุฎุจุฑุฉ ูู REST API, JWT, OAuth 2.0, Rate Limiting.
# CONTEXT
- WordPress 6.6 Headless + React Native Mobile App
- 500K+ ู
ุณุชุฎุฏู
ู
ุชููุน
- WooCommerce 9.x ููู store
- CDN + Redis Object Cache
- Load Balancer (multi-server)
# TASK
ุฃูุดุฆ REST API Namespace: `myapp/v1` ู
ุน endpoints:
- `POST /auth/login` (JWT)
- `POST /auth/refresh`
- `GET /products` (paginated, filtered, cached)
- `POST /cart/add`
- `GET /orders/{id}` (ownership validation)
- `POST /push/register`
# SECURITY REQUIREMENTS (MANDATORY)
โ
JWT ู
ุน `HS256` + refresh tokens (7 days)
โ
`permission_callback` ููู endpoint โ ูุง `__return_true` ุฃุจุฏุงู
โ
Rate limiting: 60 req/min per IP (Redis-backed)
โ
Input validation ุนุจุฑ `args` schema ูู `register_rest_route`
โ
`sanitize_callback` + `validate_callback` ููู parameter
โ
CORS ู
ููููุฏ ูุฏูู
ูู ุงูุชุทุจูู ููุท
โ
ูุง expose ููู user enumeration
โ
HTTPS ููุท + HSTS
โ
ูู response ูู
ุฑ ุนุจุฑ `WP_REST_Response`
# PERFORMANCE
- `GET /products`: cache 5 ุฏูุงุฆู ูู Redis
- Pagination: cursor-based (ููุณ offset) ููุณุฌูุงุช ุงููุจูุฑุฉ
- Response compression (gzip via nginx)
- ETag support ููู GET endpoints
# OUTPUT STRUCTURE
1. Namespace Registration
2. Authentication (JWT lib + hooks)
3. Each endpoint (route + args + callback)
4. Rate limiting middleware
5. Error handling (WP_Error standardized)
6. API Documentation (OpenAPI 3.0 spec)
7. Postman collection
text
# ERROR CONTRACT (ู
ูุญูุฏ)
```json
{
"success": false,
"error": {
"code": "invalid_token",
"message": "JWT token expired",
"status": 401
}
}
text
--- ### ๐ท ุงููุงูุจ 4: Multisite SaaS Platform ```markdown # ROLE Senior WordPress Multisite Architect โ ุฎุจุฑุฉ ูู SaaS, Subdomain Routing, Centralized Billing. # CONTEXT - WordPress Multisite (Subdomain) โ 1000+ sites ู ุชููุนุฉ - WooCommerce Subscriptions ููู billing ุงูู ุฑูุฒู - Custom Domain Mapping - CDN per-site + Shared Redis - WooCommerce HPOS per-site # TASK ุงุจูู ููุงุฉ SaaS Platform ุชุดู ู: 1. **Provisioning System**: ุฅูุดุงุก site ุฌุฏูุฏ ุขููุงู ุนูุฏ ุงูุงุดุชุฑุงู 2. **Domain Mapping**: ุฑุจุท custom domain ุจู site 3. **Centralized Billing**: WooCommerce Subscriptions ูู main site 4. **Feature Gating**: ุชูุนูู/ุชุนุทูู features ุญุณุจ ุงูุฎุทุฉ 5. **Admin Dashboard**: ุนูู main site ูุฅุฏุงุฑุฉ ูู ุงูู ุณุชุฃุฌุฑูู # ARCHITECTURE
Main Site (network admin)
โโโ /wp-admin/network/
โโโ Billing (WooCommerce Subscriptions)
โโโ Provisioning API
โ
Tenant Site (subdomain or mapped domain)
โโโ Isolated content
โโโ Shared plugins (network-activated)
โโโ Per-site options
text
# CRITICAL CONSTRAINTS - **Data Isolation**: `switch_to_blog()` ุฏุงุฆู ุงู ู ุน `restore_current_blog()` - **Hooks**: ุงุณุชุฎุฏุงู `wp_initialize_site` ู `wp_delete_site` - **Billing Sync**: webhook ู ู WooCommerce โ ุชุญุฏูุซ `blog_meta` - **Feature Flags**: ุนุจุฑ `get_site_option()` โ ููุณ `get_option()` - **Performance**: `WP_Site_Query` ู ุน caching ููู 1000 site - **Security**: Super Admin ููุท ููู provisioning # DATABASE STRATEGY - ุงุณุชุฎุฏู **Custom Tables** ููู tenant metadata (ูุง postmeta) - Index ุนูู: `blog_id`, `plan`, `status`, `expires_at` - Migration system: versioned (`db_version` option) # OUTPUT
1. Network-level plugin structure
2. Provisioning service class
3. Domain mapping handler
4. Billing webhook listener
5. Feature gating helper functions
6. Admin dashboard (React + REST)
7. Cron jobs (billing sync, cleanup)
8. Scaling notes (1000+ sites)
text
๐ท ุงููุงูุจ 5: Security Hardening Audit
markdown
# ROLE Senior WordPress Security Engineer โ ุฎุจุฑุฉ OWASP, WPScan, CVE Analysis. # CONTEXT - Plugin ู ูุฌูุฏ ุจู 50K+ installation - ุขุฎุฑ security audit: ูุจู 18 ุดูุฑ - PHP 8.2, WP 6.6 # TASK Audit ุฃู ูู ูุงู ู ููููุฏ ุงูู ุฑูู [ุฃุฑูู ุงูููุฏ]. # CHECKLIST ## Input Handling - [ ] ูู `$_GET/$_POST/$_REQUEST` ูู ุฑ ุนุจุฑ sanitization - [ ] `$_FILES` validated (mime, size, extension) - [ ] JSON input validated schema ## Output Escaping - [ ] `esc_html()`, `esc_attr()`, `esc_url()`, `esc_js()` - [ ] `wp_kses_post()` ููู HTML ุงูู ุณู ูุญ - [ ] `wp_json_encode()` โ ููุณ `json_encode()` ## Authentication & Authorization - [ ] `current_user_can()` ูู ูู admin action - [ ] `wp_verify_nonce()` ูู ูู form/AJAX - [ ] ูุง privilege escalation vectors - [ ] Capability checks ุฏูููุฉ (ููุณ `manage_options` ุฏุงุฆู ุงู) ## SQL Injection - [ ] `$wpdb->prepare()` ููู query ุฏููุงู ููู - [ ] ูุง interpolation ูู `ORDER BY` (ุงุณุชุฎุฏู whitelist) - [ ] `LIKE` ู ุน `$wpdb->esc_like()` ## CSRF / XSS / SSRF - [ ] ูุง `file_get_contents` ุนูู user input - [ ] `wp_safe_remote_get()` โ ููุณ `wp_remote_get()` - [ ] Whitelist ููู allowed hosts ## File Operations - [ ] `WP_Filesystem` โ ูุง `file_put_contents` ู ุจุงุดุฑ - [ ] Path traversal prevention - [ ] Upload directory restrictions ## Secrets & Config - [ ] ูุง hardcoded API keys - [ ] ุงุณุชุฎุฏุงู `wp-config.php` constants # OUTPUT FORMAT ```markdown ## ๐ด CRITICAL (Fix immediately) ### Issue: [ุงุณู ] - **Location**: file.php:123 - **Risk**: [ูุตู] - **PoC**: [ููุฏ ุงุณุชุบูุงู] - **Fix**: [ููุฏ ู ูุตูุญ] ## ๐ HIGH ## ๐ก MEDIUM ## ๐ข LOW ## Summary Table | Severity | Count | CVSS Avg |
DELIVERABLES
- Audit report
- Patched code (diff format)
- Security test cases
- Updated
readme.txtsecurity changelog
text
---
### ๐ท ุงููุงูุจ 6: Performance Optimization Sprint
```markdown
# ROLE
Senior WordPress Performance Engineer โ Core Web Vitals specialist.
# CONTEXT
- WooCommerce store ุจู 10K products
- ุตูุญุฉ Category ุจุทูุฆุฉ (8s LCP)
- TTFB: 2.5s | DB Queries: 450 | Memory: 512MB
# TASK
ุญุณูู ุงูุฃุฏุงุก ูุชุญููู:
- LCP < 2.5s
- TTFB < 500ms
- DB Queries < 50
- Memory < 128MB
# METHODOLOGY (ุงุชุจุน ูุฐุง ุงูุชุฑุชูุจ)
1. **Profiling** โ Query Monitor + New Relic
2. **Identify Bottlenecks** โ top 10 slow queries
3. **Optimize Layer by Layer**:
a. Database (indexes, query rewrite)
b. Object Cache (Redis)
c. Page Cache (nginx/Varnish)
d. CDN
e. Frontend (critical CSS, lazy load)
# OPTIMIZATION PATTERNS
## Database
```php
// โ BAD
$products = get_posts(['post_type' => 'product', 'meta_key' => '_price']);
// โ
GOOD
$products = wc_get_products([
'limit' => 20,
'status' => 'publish',
'return' => 'objects',
'cache_results' => true,
]);
Caching
php
$key = 'category_products_' . $cat_id;
$data = wp_cache_get($key, 'my_plugin');
if (false === $data) {
$data = expensive_query();
wp_cache_set($key, $data, 'my_plugin', 3600);
}
N+1 Prevention
php
// ุชุญู
ูู meta ุจุดูู batched
update_meta_cache('post', $post_ids);
update_postmeta_cache($post_ids);
OUTPUT
- Before/After metrics (table)
- Optimized code (diff)
- Redis config recommendations
- nginx rules (fastcgi_cache)
- Monitoring setup (New Relic / Query Monitor)
- Regression prevention strategy
text
--- ### ๐ท ุงููุงูุจ 7: Testing Strategy (PHPUnit + WP_Mock) ```markdown # ROLE Senior PHP Testing Engineer โ ุฎุจุฑุฉ PHPUnit, Brain Monkey, WP_Mock, Codeception. # CONTEXT - Plugin ู ูุฌูุฏ ุจุฏูู tests - PHP 8.2, PHPUnit 10.x - WordPress 6.6, WooCommerce 9.x - CI: GitHub Actions # TASK ุงุจูู Testing Suite ูุงู ูุฉ ููู plugin. # TEST PYRAMID
/
/E2E\ 10% (Codeception)
/——
/Integr. \ 30% (WP_UnitTestCase)
/———-
/ Unit \ 60% (PHPUnit + Mockery)
/————–\
text
# STRUCTURE
tests/
โโโ Unit/
โ โโโ Domain/
โ โ โโโ OrderCalculatorTest.php
โ โโโ Infrastructure/
โ โโโ RepositoryTest.php
โโโ Integration/
โ โโโ Admin/
โ โโโ RestApi/
โโโ E2E/
โ โโโ checkout.spec.php
โโโ bootstrap.php
โโโ phpunit.xml.dist
โโโ _fixtures/
text
# TOOLS
- **Unit**: PHPUnit + Mockery + Brain Monkey
- **Integration**: WP_UnitTestCase
- **E2E**: Codeception + wp-browser
- **Coverage**: Xdebug + Codecov (ูุฏู: 85%+)
# EXAMPLE TEST
```php
<?php
declare(strict_types=1);
namespace MyPlugin\Tests\Unit\Domain;
use PHPUnit\Framework\TestCase;
use MyPlugin\Domain\OrderCalculator;
final class OrderCalculatorTest extends TestCase
{
public function test_calculates_free_shipping_above_threshold(): void
{
$calculator = new OrderCalculator(threshold: 500.0);
self::assertTrue($calculator->qualifiesForFreeShipping(500.0));
self::assertFalse($calculator->qualifiesForFreeShipping(499.99));
}
}
CI PIPELINE (GitHub Actions)
yaml
jobs:
test:
strategy:
matrix:
php: [8.1, 8.2, 8.3]
wp: [latest, '6.5']
steps:
- run: composer install
- run: composer test
- run: composer test-coverage
- uses: codecov/codecov-action@v4
OUTPUT
- Directory structure
composer.json(dev deps + scripts)phpunit.xml.distbootstrap.php- 10 sample tests (unit + integration)
- CI workflow
- Coverage report config
text
--- ## ๐ญ ุงูุฌุฒุก ุงูุซุงูุซ: ุชูููุงุช ู ุชูุฏู ุฉ ### ๐งฉ ุชูููุฉ 1: "Persona Stacking" (ุชูุฏูุณ ุงูุฃุฏูุงุฑ) ุจุฏูุงู ู ู ุฏูุฑ ูุงุญุฏุ ุงุทูุจ ุฃุฏูุงุฑุงู ู ุชุนุฏุฏุฉ ูู ุชุณูุณู: ```markdown ุงูุชุจ ุงูุฑุฏ ุนูู 3 ู ุฑุงุญูุ ูู ู ุฑุญูุฉ ุจู ููุฏุณ ู ุฎุชูู: **[ARCHITECT]** ุตู ูู ุงูู ุนู ุงุฑูุฉ ููุท โ ุจุฏูู ููุฏ **[DEVELOPER]** ูููุฐ ุงูู ุนู ุงุฑูุฉ โ ููุฏ ูุงู ู **[REVIEWER]** ุฑุงุฌุน ุงูููุฏ ู ู ู ูุธูุฑ ุงูุฃุฏุงุก ูุงูุฃู ุงู โ ุงูุชุฑุญ ุชุญุณููุงุช
๐งฉ ุชูููุฉ 2: “Constraint Stacking” (ุชูุฏูุณ ุงููููุฏ)
ูู ููุฏ ููุถุงู ูููู ู ุณุงุญุฉ ุงูุฎุทุฃ:
markdown
Level 1: ุงูุชุจ ุฏุงูุฉ ูุญุณุงุจ ุงูุดุญู Level 2: + ุงุณุชุฎุฏู PSR-12 Level 3: + strict_types Level 4: + unit tests Level 5: + performance < 5ms Level 6: + cached with transients Level 7: + HPOS compatible
๐งฉ ุชูููุฉ 3: “Negative Prompting” (ุงูู ุทุงูุจุฉ ุงูุณูุจูุฉ)
ุฃุฎุจุฑ ุงูู AI ุจู ุง ูุง ูุฌุจ ูุนูู:
markdown
โ ูุง ุชุณุชุฎุฏู `extract()` โ ูุง ุชุณุชุฎุฏู `eval()` โ ูุง ุชุณุชุฎุฏู `@` operator โ ูุง ุชุณุชุฎุฏู `global $wpdb` ู ุจุงุดุฑุฉ โ ูุง ุชูุชุจ ููุฏ ุจุฏูู type hints โ ูุง ุชุณุชุฎุฏู `get_posts()` ููู products โ ุงุณุชุฎุฏู `wc_get_products()`
๐งฉ ุชูููุฉ 4: “Few-Shot with Style Guide”
ุฃุนุทู 2-3 ุฃู ุซูุฉ ุนูู ููุฏ ุจุฃุณููุจู:
markdown
ุงุชุจุน ูุฐุง ุงูุฃุณููุจ ุจุงูุถุจุท:
ู
ุซุงู 1:
```php
final class ProductRepository
{
public function __construct(
private readonly \wpdb $db,
private readonly string $table
) {}
public function findById(int $id): ?Product
{
// ...
}
}
ู
ุซุงู 2:
[ููุฏ ุขุฎุฑ ุจููุณ ุงูุฃุณููุจ]
text
### ๐งฉ ุชูููุฉ 5: "Iterative Refinement Loop" ```markdown ุงูุฌููุฉ 1: ุงูุชุจ ุงูุญู ุงูุฃุณุงุณู ุงูุฌููุฉ 2: ุญุณูู ุงูุฃุฏุงุก โ ุงุฐูุฑ 3 ุชุญุณููุงุช ุงูุฌููุฉ 3: ุนุฒูุฒ ุงูุฃู ุงู โ ุงุฐูุฑ 3 ุซุบุฑุงุช ู ุญุชู ูุฉ ุงูุฌููุฉ 4: ุฃุถู tests โ ุบุทูู 85% ุงูุฌููุฉ 5: ุฑุงุฌุน ูู ุดูุก โ ุณููู ุงููุณุฎุฉ ุงูููุงุฆูุฉ
๐งฉ ุชูููุฉ 6: “Adversarial Review”
markdown
ุจุนุฏ ูุชุงุจุฉ ุงูููุฏุ ุชุตุฑูู ูู: 1. **Hacker** โ ุงุจุญุซ ุนู ุซุบุฑุงุช 2. **DBA** โ ุงุจุญุซ ุนู ู ุดุงูู queries 3. **DevOps** โ ุงุจุญุซ ุนู ู ุดุงูู deployment 4. **QA** โ ุงุจุญุซ ุนู edge cases 5. **Junior Dev** โ ูู ุงูููุฏ ู ูููู ุ ุงูุชุจ ุชูุฑูุฑุงู ู ู ูู ู ูุธูุฑ.
๐ ุงูุฌุฒุก ุงูุฑุงุจุน: ู ุตูููุฉ ุงููุฑุงุฑ
| ุงูุณููุงุฑูู | ุงููู ูุฐุฌ ุงูู ูุถู | ู ุฏุฉ ุงูู Prompt | Output |
|---|---|---|---|
| Bug fix ุจุณูุท | Claude Sonnet | 5 ุฃุณุทุฑ | diff |
| Feature ุฌุฏูุฏุฉ | GPT-4 / Claude Opus | 50 ุณุทุฑ | ููุฏ ูุงู ู |
| Refactor ูุจูุฑ | Claude Opus + Chain | 200 ุณุทุฑ | ูุจู/ุจุนุฏ |
| Security audit | Claude Opus | 300 ุณุทุฑ | ุชูุฑูุฑ |
| Architecture design | GPT-4 + Persona | 100 ุณุทุฑ | ู ุฎุทุท |
| Migration | Claude Opus | 250 ุณุทุฑ | script + rollback |
| Testing suite | Claude Opus | 200 ุณุทุฑ | ูู ุงูู tests |
๐ฏ ุงูุฌุฒุก ุงูุฎุงู ุณ: ูุตุงุฆุญ ุฐูุจูุฉ
1๏ธโฃ ูู ู ุญุฏุฏุงู ุจุงูุฃุฑูุงู
โ “ุงุฌุนู ุงูุฃุฏุงุก ุฃูุถู”
โ
“TTFB < 500msุ DB queries < 50ุ LCP < 2.5s”
2๏ธโฃ ุญุฏุฏ ุงูุจูุฆุฉ ุจุงููุงู ู
โ “ุงุณุชุฎุฏู
WordPress”
โ
“WP 6.6 + WC 9.2 + PHP 8.2 + MySQL 8.0 + Redis 7”
3๏ธโฃ ุงุทูุจ ุงูุฃุฎุทุงุก ุฃููุงู
“ูุจู ุงูููุฏุ ุงุฐูุฑ 5 ุทุฑู ูู ูู ุฃู ููุดู ุจูุง ูุฐุง ุงูุญู”
4๏ธโฃ ุงุทูุจ ุงุฎุชุจุงุฑุงุช ู ุน ุงูููุฏ
“ู ุน ูู ู ูู ููุฏุ ุฃุฑูู ู ูู test ู ูุงุจู ูู”
5๏ธโฃ ุงุณุชุฎุฏู Terms ุชูููุฉ ุฏูููุฉ
ุจุฏูุงู ู ู “ุฌูุฏ”ุ ูู “SOLID-compliant, PSR-12, DDD-layered”
6๏ธโฃ ููู ุงูู ูุงู ุงูู ุนูุฏุฉ
10 prompts ุตุบูุฑุฉ > 1 prompt ุถุฎู
7๏ธโฃ ุงุทูุจ ุงูุดุฑุญ
“ุงุดุฑุญ ูู ุงุฐุง ุงุฎุชุฑุช ูุฐู ุงูู ุนู ุงุฑูุฉ ูููุณ ุงูุจุฏูู”
8๏ธโฃ ุญุฏุฏ Anti-Requirements
“ูุง ุชุณุชุฎุฏู : Symfony, Laravel, ุฃู framework ุฎุงุฑุฌู”
9๏ธโฃ ุงุทูุจ Roadmap
“ูุณูู ุงูุชูููุฐ ุฅูู 5 ู ุฑุงุญูุ ูู ู ุฑุญูุฉ ูุงุจูุฉ ููุงุฎุชุจุงุฑ”
๐ ูุซูู ูู ุดูุก
“ุฃุถู DocBlocks + README + CHANGELOG + inline comments ููุฃุฌุฒุงุก ุงูู ุนูุฏุฉ”
๐ ุงูุฌุฒุก ุงูุณุงุฏุณ: Prompt Master Template (All-in-One)
markdown
# ROLE [Senior Engineer + Specialization + Years] # CONTEXT ## Stack - PHP: [version] - WordPress: [version] - WooCommerce: [version] - Database: [MySQL/MariaDB + version] - Cache: [Redis/Memcached] - Server: [nginx/Apache + version] ## Project - Type: [Plugin/Theme/Add-on] - Scale: [users/orders/sites] - Multisite: [Yes/No] - HPOS: [Enabled/Disabled] - Standards: [PSR-12 + WPCS] # TASK [ูุตู ุฏููู] # REQUIREMENTS ## Functional 1. ... ## Non-Functional - Performance: ... - Security: ... - Scalability: ... - i18n: ... # CONSTRAINTS ## DO โ ... ## DON'T โ ... # ARCHITECTURE - Pattern: [MVC/DDD/Repository] - DI: [Constructor/Container] - File Structure: [tree] # OUTPUT FORMAT ## 1. Architecture Overview ## 2. File Tree ## 3. Code (per file) ## 4. Installation ## 5. Testing ## 6. Edge Cases ## 7. Performance Notes # QUALITY GATES - [ ] Security: ... - [ ] Performance: ... - [ ] Compatibility: ... - [ ] Testing: ... # CLARIFICATIONS ุฅุฐุง ูุงู ุฃู ู ุชุทูุจ ุบุงู ุถุงูุ ุงุณุฃู ูุจู ุงูููุฏ.
๐ ุฎูุงุตุฉ ุชูููุฐูุฉ
ุงูู Prompt ุงูุงุญุชุฑุงูู = Ticket ูู Jira + Design Doc + Code Review Guidelines ูู ุฑุณุงูุฉ ูุงุญุฏุฉ.
ุซูุงุซ ููุงุนุฏ ูุง ุชููุณุฑ:
- ุณูุงู ูุงู ู โ ูุง ุชูุชุฑุถ ุฃู ุงูู AI ูุนุฑู ุจูุฆุชู
- ูููุฏ ุตุฑูุญุฉ โ ู ุง ูุง ุชู ูุนูุ ูุฏ ูุญุฏุซ
- ู ุฎุฑุฌุงุช ู ุญุฏุฏุฉ โ ุญุฏุฏ ุงูุดูู ูุจู ุงูู ุญุชูู
ูู ุชุฑูุฏ ุฃู ุฃุชูุณุน ูู ุฃุญุฏ ูุฐู ุงูู ุญุงูุฑุ
- ๐ธ AI Agents ูุจูุงุก WordPress plugins (multi-step)
- ๐ธ Cursor / Cline / Windsurf rules ู ุฎุตุตุฉ ูู WP
- ๐ธ RAG ุนูู documentation ุงูุฎุงุต ุจู ุดุฑูุนู
- ๐ธ Fine-tuning ููู ูุฐุฌ ุนูู codebase ุดุฑูุชู
- ๐ธ Prompt Versioning ู CI/CD ููู prompts
ุงูุฌุฒุก ุงูุซุงูุซ: ุงูู ูุณูุนุฉ ุงููุงู ูุฉ โ ู ู Prompt Engineering ุฅูู AI-Driven Development
๐ญ ุงููุณู ุงูุฃูู: AI Agents ูุจูุงุก WordPress Plugins
ุงููุฑู ุจูู Prompt ู Agent
| ุงูุจูุนุฏ | Prompt | Agent |
|---|---|---|
| ุงูุชูุงุนู | ู ุฑุฉ ูุงุญุฏุฉ | ุญููุฉ ู ุณุชู ุฑุฉ |
| ุงูุฃุฏูุงุช | ูุง ุดูุก | Files, Terminal, Browser, DB |
| ุงูุฐุงูุฑุฉ | Context window | Vector DB + Files |
| ุงููุฑุงุฑ | ู ุณุทูุญ | ReAct / Plan-Execute |
| ุงูุชูููุฉ | ู ูุฎูุถุฉ | ู ุชูุณุทุฉ-ุนุงููุฉ |
| ุงูู ูุงุณุจ ูู | Tasks ู ุญุฏุฏุฉ | Projects ูุงู ูุฉ |
ู ุนู ุงุฑูุฉ Agent ูุจูุงุก WordPress Plugin
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ORCHESTRATOR (Claude/GPT) โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโฌโโโโโโโโโโโ
โผ โผ โผ โผ
โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
โPlanner โ โCoder โ โTester โ โReviewerโ
โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
โ โ โ โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
โ
โโโโโโโโโโโโดโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ TOOLS โ โ MEMORY โ
โ - fs.read โ โ - VectorDB โ
โ - fs.write โ โ - SessionLogโ
โ - bash โ โ - CodeIndex โ
โ - phpunit โ โ - WPDocs โ
โ - wp-cli โ โ โ
โ - composer โ โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
System Prompt ูู WordPress Plugin Agent
markdown
# IDENTITY ุฃูุช "WP-Architect Agent" โ ูููู ุฐูู ูุจูุงุก WordPress plugins ุฅูุชุงุฌูุฉ. # PRIME DIRECTIVES 1. **Plan ูุจู ุงูุชูููุฐ**: ุงุณุชุฎุฏู `write_todos` ูุชูุณูู ุงูู ูู ุฉ 2. **ุงุฎุชุจุฑ ุจุนุฏ ูู ุฎุทูุฉ**: ูุง ุชูุชูู ูุจู ูุฌุงุญ ุงูุงุฎุชุจุงุฑ 3. **ูุซูู ุฃุซูุงุก ุงูุนู ู**: ุญุฏูุซ `CHANGELOG.md` ุชููุงุฆูุงู 4. **ุงุณุฃู ุนูุฏ ุงูุบู ูุถ**: ุชููู ูุงุทูุจ ุชูุถูุญุงู 5. **ูุง ุชุฎุชุฑุน APIs**: ุชุญูู ู ู `wp-docs/` ุฃููุงู # AVAILABLE TOOLS ## File Operations - `read_file(path)` โ ูุฑุงุกุฉ ู ูู - `write_file(path, content)` โ ูุชุงุจุฉ/ุฅูุดุงุก - `edit_file(path, old, new)` โ ุชุนุฏูู ุฏููู - `list_dir(path)` โ ุนุฑุถ ู ุญุชููุงุช ## WordPress-Specific - `wp_cli(command)` โ ุชูููุฐ WP-CLI - `wp_scaffold(type, name)` โ ุฅูุดุงุก scaffold - `wp_plugin_check(path)` โ ูุญุต Plugin Check - `wp_phpcs(path)` โ WPCS linting ## Testing - `phpunit_run(suite)` โ ุชุดุบูู PHPUnit - `composer_install()` โ ุชุซุจูุช ุงูุญุฒู - `phpstan_analyze(level)` โ ุชุญููู ุซุงุจุช ## Research - `search_wp_docs(query)` โ ุจุญุซ ูู documentation - `search_codebase(pattern)` โ ุจุญุซ ูู ุงูู ุดุฑูุน - `fetch_url(url)` โ ุฌูุจ ุตูุญุฉ # WORKFLOW (ReAct Loop)
THOUGHT: ู
ุง ุงูุฐู ุฃุญุชุงุฌู ุงูุขูุ
ACTION: [tool_name]
INPUT: {params}
OBSERVATION: [ูุชูุฌุฉ ุงูุฃุฏุงุฉ]
… (ุชูุฑุฑ)
FINAL: [ุงูู
ูุฎุต ุงูููุงุฆู]
text
# PLANNING TEMPLATE ุนูุฏ ุงุณุชูุงู ู ูู ุฉุ ุฃูุดุฆ TODOs ุจูุฐุง ุงูุดูู:
[ ] 1. Research: ุงูุจุญุซ ุนู best practices
[ ] 2. Design: ุฑุณู
ุงูู
ุนู
ุงุฑูุฉ
[ ] 3. Scaffold: ุฅูุดุงุก ูููู ุงูู
ููุงุช
[ ] 4. Implement: ูุชุงุจุฉ ุงูููุฏ module by module
[ ] 5. Test: ูุชุงุจุฉ ูุชุดุบูู ุงูุงุฎุชุจุงุฑุงุช
[ ] 6. Lint: PHPCS + PHPStan
[ ] 7. Review: ู
ุฑุงุฌุนุฉ ุฐุงุชูุฉ
[ ] 8. Document: README + CHANGELOG
text
# GUARDRAILS - โ ูุง ุชูุชุจ ู ูู > 500 ุณุทุฑ โ ูุณูู ู - โ ูุง ุชุณุชุฎุฏู deprecated functions - โ ูุง ุชุชุฌุงูุฒ Quality Gates - โ ุงุฎุชุจุฑ ูุจู ูู commit - โ ุงุณุชุฎุฏู `declare(strict_types=1)` ุฏุงุฆู ุงู - โ ุฃุถู DocBlocks # OUTPUT AT END 1. File tree ุงูููุงุฆู 2. Test coverage report 3. PHPCS/PHPStan results 4. CHANGELOG 5. Installation instructions 6. Next steps suggestions
ู ุซุงู ุชูููุฐู: Agent ูุจูู Plugin ูุงู ู
markdown
# USER TASK
ุงุจูู plugin ูุฅุฏุงุฑุฉ "ุฎุตูู
ุงุช ุงูุนู
ูุงุก ุงูู
ู
ูุฒูู" ูู WooCommerce.
# AGENT EXECUTION TRACE
## Step 1 โ Planning
THOUGHT: ุฃุญุชุงุฌ ุฃููุงู ููู
ุงูู
ุชุทูุจุงุช ูุชูุณูู
ูุง
ACTION: write_todos([
"Research: WooCommerce discount hooks",
"Design: Architecture",
"Scaffold: Plugin structure",
"Implement: Discount engine",
"Implement: Admin UI",
"Implement: Frontend display",
"Test: Unit + Integration",
"Lint: PHPCS",
"Document: README"
])
## Step 2 โ Research
THOUGHT: ุฃุญุชุงุฌ hooks ุงูุตุญูุญุฉ ููุฎุตูู
ุงุช
ACTION: search_wp_docs("WooCommerce cart discount hooks")
OBSERVATION:
- `woocommerce_cart_calculate_fees` โ ุงูุฃูุถู
- `woocommerce_before_calculate_totals` โ ุจุฏูู
- ุชุฌููุจ `woocommerce_get_discounted_price` (deprecated)
## Step 3 โ Design
THOUGHT: ุงูู
ุนู
ุงุฑูุฉ ุงูู
ูุชุฑุญุฉ
ARCHITECTURE:
vip-discounts/
โโโ src/
โ โโโ Domain/
โ โ โโโ DiscountRule.php
โ โ โโโ DiscountCalculator.php
โ โโโ Application/
โ โ โโโ ApplyDiscountService.php
โ โโโ Infrastructure/
โ โ โโโ WooCommerce/
โ โ โ โโโ CartIntegration.php
โ โ โโโ Persistence/
โ โ โโโ RuleRepository.php
โ โโโ Admin/
โ โโโ SettingsPage.php
text
## Step 4 โ Scaffold
ACTION: bash("wp scaffold plugin vip-discounts --plugin_name='VIP Discounts'")
OBSERVATION: โ
Created 12 files
## Step 5-N โ Implement (ูุณุชู
ุฑ...)
## Final Report
โ
Plugin ุฌุงูุฒ
โ
47 tests passing (92% coverage)
โ
PHPCS: 0 errors
โ
PHPStan Level 8: 0 errors
๐๏ธ ุงููุณู ุงูุซุงูู: Cursor / Cline / Windsurf Rules
.cursorrules ูู WordPress Projects
markdown
# WordPress Engineering Standards
## Identity
You are a Senior WordPress Engineer with 15+ years of experience.
You write production-grade code, not demos.
## Code Style
- PSR-12 + WordPress Coding Standards (WPCS)
- `declare(strict_types=1);` in every PHP file
- Type hints for parameters and return types (PHP 8 syntax)
- Namespaces: `Vendor\PluginName\Layer\Class`
- File names match class names (PSR-4)
## Forbidden Patterns
- โ `query_posts()` โ use `WP_Query`
- โ `get_posts()` for products โ use `wc_get_products()`
- โ Direct `$wpdb` queries without `prepare()`
- โ `extract()`, `eval()`, `@` operator
- โ `get_option()` in loops
- โ `get_post_meta()` for orders (HPOS incompatible)
- โ Deprecated functions since WP 5.0
## Mandatory Patterns
### Security
```php
// Always: capability + nonce + sanitize + escape
if (!current_user_can('manage_options')) {
wp_die(esc_html__('Unauthorized', 'text-domain'));
}
check_admin_referer('my_action', 'my_nonce');
$value = isset($_POST['field'])
? sanitize_text_field(wp_unslash($_POST['field']))
: '';
echo esc_html($value);
Database
php
$results = $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}my_table WHERE id = %d AND status = %s",
$id,
$status
)
);
WooCommerce (HPOS-safe)
php
$order = wc_get_order($order_id);
if (!$order) return;
$total = $order->get_total();
$order->update_meta_data('_custom_field', $value);
$order->save();
File Organization
- Never exceed 500 lines per file
- One class per file
- Max 20 methods per class
- Max 40 lines per method
- Max 4 parameters per function (use DTO if more)
Testing Requirements
- Every public method needs a test
- Minimum coverage: 85%
- Use PHPUnit 10+ with Brain Monkey for WP functions
Documentation
- Every class: DocBlock with @since, @package
- Every public method: @param, @return, @throws
- Complex logic: inline comments explaining “why” not “what”
When Responding
- First understand the existing codebase
- Propose architecture before coding
- Write tests before implementation (TDD)
- Run linters after every change
- Update CHANGELOG.md
Context Awareness
- Read
composer.jsonto know dependencies - Read
.wp-env.jsonto know environment - Check
phpcs.xml.distfor linting rules - Respect existing patterns in the codebase
text
### `.clinerules` (Cline-specific)
```markdown
# Cline Agent Rules
## Tool Usage
- ALWAYS use `execute_command` with `wp-cli` for DB operations
- NEVER modify files outside `/wp-content/plugins/{current-plugin}/`
- Use `read_file` before any `replace_in_file`
- After each edit, run `phpcs` on the modified file
## Approval Gates
Require approval for:
- `rm` any file
- `composer update`
- DB migrations
- `git push` operations
## Auto-actions (no approval needed)
- `composer install`
- `phpunit`
- `phpcs`
- `phpstan`
- `read_file`
## Error Recovery
If PHPCS fails:
1. Read the specific error
2. Fix the exact issue
3. Re-run PHPCS
4. Max 3 iterations before asking user
windsurf.rules
markdown
# Windsurf WordPress Rules ## Cascades - Always cascade changes through Domain โ Application โ Infrastructure - Never skip layers - Update tests when changing Domain ## Memory - Remember project conventions - Remember last 10 changes - Suggest refactors when patterns emerge ## Multi-file edits - When editing a class, update: 1. The class file 2. Its test file 3. Any interface it implements 4. The DI container registration
๐ ุงููุณู ุงูุซุงูุซ: RAG ุนูู Documentation ุงูุฎุงุต ุจู ุดุฑูุนู
ูู ุงุฐุง RAG ูููุณ Fine-tuningุ
| ุงูุจูุนุฏ | RAG | Fine-tuning |
|---|---|---|
| ุงูุชูููุฉ | ู ูุฎูุถุฉ | ุนุงููุฉ ุฌุฏุงู |
| ุงูุชุญุฏูุซ | ููุฑู | ูุญุชุงุฌ ุฅุนุงุฏุฉ ุชุฏุฑูุจ |
| ุงูุฏูุฉ | ู ู ุชุงุฒุฉ ููู ุตุงุฏุฑ | ุฃูุถู ููู style |
| ุงูุดูุงููุฉ | ูุดูุฑ ููู ุตุฏุฑ | ุตูุฏูู ุฃุณูุฏ |
| ุงูุฃุฏูุงุช | LangChain, LlamaIndex | OpenAI, Anthropic |
ู ุนู ุงุฑูุฉ RAG ูู WordPress Plugin Development
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INGESTION PIPELINE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Sources: โ
โ โข WP Core source code โ
โ โข WooCommerce source code โ
โ โข Plugin's own codebase โ
โ โข WP Developer Handbook (HTML) โ
โ โข WP-CLI docs โ
โ โข Custom internal docs (Confluence) โ
โ โข Past PRs + Reviews โ
โ โข Bug reports + resolutions โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CHUNKING STRATEGY โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Code: function-level (AST-aware) โ
โ Docs: section-level (500 tokens) โ
โ PRs: full-thread chunks โ
โ Bugs: title + description + fix โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EMBEDDING โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Model: text-embedding-3-large โ
โ Dims: 3072 โ
โ Store: Pinecone / Weaviate / pgvectorโ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RETRIEVAL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Hybrid Search: โ
โ โข Semantic (vector) โ
โ โข Keyword (BM25) โ
โ โข Reranking (Cohere) โ
โ โข Metadata filtering (post_type,ver) โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GENERATION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Prompt = System + Context + Query โ
โ Model: Claude Opus / GPT-4 โ
โ Cite sources โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ู ุซุงู ููุฏ RAG (Python + LangChain)
python
from langchain.document_loaders import TextLoader, DirectoryLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Pinecone
from langchain.chat_models import ChatAnthropic
from langchain.chains import RetrievalQA
from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.document_compressors import CohereRerank
# 1. Load WordPress plugin codebase
loader = DirectoryLoader(
"./wp-content/plugins/my-plugin/",
glob="**/*.php",
loader_cls=TextLoader
)
docs = loader.load()
# 2. AST-aware chunking (per function)
splitter = RecursiveCharacterTextSplitter.from_language(
language="php",
chunk_size=800,
chunk_overlap=100
)
chunks = splitter.split_documents(docs)
# 3. Embed + Store
embeddings = OpenAIEmbeddings(model="text-embedding-3-large")
vectorstore = Pinecone.from_documents(
chunks, embeddings, index_name="wp-plugin-codebase"
)
# 4. Hybrid retriever + Reranker
retriever = vectorstore.as_retriever(search_kwargs={"k": 20})
reranker = CohereRerank(model="rerank-multilingual-v3.0")
compression_retriever = ContextualCompressionRetriever(
base_compressor=reranker,
base_retriever=retriever
)
# 5. QA Chain
llm = ChatAnthropic(model="claude-opus-4")
qa = RetrievalQA.from_chain_type(
llm=llm,
retriever=compression_retriever,
return_source_documents=True
)
# 6. Query
result = qa.invoke({
"query": "ููู ูุชู
ุญุณุงุจ ุงูุฎุตู
ูู ุงูููุงุณ DiscountCalculatorุ"
})
print(result["result"])
print("Sources:", [d.metadata["source"] for d in result["source_documents"]])
Prompt Augmented ุจุงูู RAG
markdown
# SYSTEM
ุฃูุช Senior WordPress Engineer. ุงุณุชุฎุฏู
ุงูุณูุงู ุงูู
ูุฑูู ู
ู codebase ุงูู
ุดุฑูุน ููุฅุฌุงุจุฉ.
# RETRIEVED CONTEXT (ู
ู RAG)
## ู
ู `src/Domain/DiscountCalculator.php:45`
```php
public function calculate(Cart $cart): Money
{
$subtotal = $cart->getSubtotal();
$tier = $this->tierResolver->resolve($cart->getCustomer());
return $subtotal->multiply($tier->getMultiplier());
}
ู
ู tests/Unit/DiscountCalculatorTest.php:78
php
public function test_applies_vip_tier_multiplier(): void
{
// ...
}
ู
ู WP Developer Handbook: woocommerce_cart_calculate_fees
ูุฐุง ุงูู hook ูู ุงูุทุฑููุฉ ุงูู ูุตู ุจูุง ูุฅุถุงูุฉ fees/discounts…
QUERY
ุฃุฑูุฏ ุฅุถุงูุฉ tier ุฌุฏูุฏ “Platinum” ุจุฎุตู 25%. ููู ุฃูุนู ุฐูู ุจู ุง ูุชูุงูู ู ุน ุงูููุฏ ุงูุญุงููุ
INSTRUCTIONS
- ุงุณุชุดูุฏ ุจุงูู ููุงุช ุงูุชู ุงุนุชู ุฏุช ุนูููุง
- ุงูุชุฑุญ ุชุนุฏููุงุช ุนูู ุงูู ููุงุช ุงููุนููุฉ
- ุงุชุจุน ููุณ ุงูุฃูู ุงุท ุงูู ูุฌูุฏุฉ
- ุงูุชุฑุญ tests ู ุทุงุจูุฉ
text
--- ## ๐งฌ ุงููุณู ุงูุฑุงุจุน: Fine-tuning ููู ูุฐุฌ ุนูู codebase ุงูุดุฑูุฉ ### ู ุชู ุชุฎุชุงุฑ Fine-tuningุ
ุงุณุชุฎุฏู
Fine-tuning ุฅุฐุง:
โ
ูุฏูู 1000+ ู
ุซุงู ุนูู “input โ output” ุงูู
ุทููุจ
โ
ุงูุฃุณููุจ (style) ู
ูู
ุฃูุซุฑ ู
ู ุงูู
ุนุฑูุฉ
โ
ุชุญุชุงุฌ ูู
ูุฐุฌุงู ุตุบูุฑุงู/ุณุฑูุนุงู/ุฑุฎูุตุงู
โ
ุนูุฏู privacy concerns ููุง ุชุฑูุฏ ุฅุฑุณุงู ุงูุณูุงู ููู API
ูุง ุชุณุชุฎุฏู
Fine-tuning ุฅุฐุง:
โ ุชุญุชุงุฌ ู
ุนููู
ุงุช ู
ุญุฏุซุฉ (ุงุณุชุฎุฏู
RAG)
โ ุนูุฏู < 500 ู
ุซุงู
โ ุงูุจูุงูุงุช ุญุณุงุณุฉ ูู
ุชุบูุฑุฉ ููู
ูุงู
text
### Pipeline ูุงู ู ูู Fine-tuning
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. DATA COLLECTION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Past PRs: code + review comments โ
โ โข Bug fixes: issue + resolution โ
โ โข Code reviews: comments as instructions โ
โ โข Commits: diff as example โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 2. DATA PREPARATION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Format: ChatML / Alpaca / ShareGPT โ
โ Clean: remove noise, PII, secrets โ
โ Balance: mix of tasks (bug, feature, refac)โ
โ Split: 80% train, 10% val, 10% test โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 3. FORMAT (JSONL) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ {“messages”: [ โ
โ {“role”:”system”,”content”:”…”}, โ
โ {“role”:”user”,”content”:”…”}, โ
โ {“role”:”assistant”,”content”:”…”} โ
โ ]} โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 4. TRAINING โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข OpenAI: gpt-4o-mini fine-tuning โ
โ โข Anthropic: Claude (enterprise) โ
โ โข Local: Llama 3.1 + LoRA (Unsloth) โ
โ โข Hyperparams: lr=1e-5, epochs=3, batch=4 โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 5. EVALUATION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข PHPCS pass rate โ
โ โข PHPStan errors โ
โ โข Test pass rate โ
โ โข Human review (5% sample) โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 6. DEPLOYMENT โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Versioned model IDs โ
โ โข A/B test vs base model โ
โ โข Rollback plan โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
### ู
ุซุงู JSONL ููุชุฏุฑูุจ
```jsonl
{"messages":[
{"role":"system","content":"You are a Senior WordPress Engineer. Write production-ready PHP following WPCS and PSR-12."},
{"role":"user","content":"Create a WooCommerce shipping method for free shipping over 500 SAR, HPOS-compatible."},
{"role":"assistant","content":"<?php\ndeclare(strict_types=1);\n\nnamespace MyPlugin\\Shipping;\n\nuse WC_Shipping_Method;\n\nfinal class FreeShippingOver500 extends WC_Shipping_Method\n{\n public function __construct(int $instance_id = 0)\n {\n $this->id = 'free_over_500';\n $this->instance_id = absint($instance_id);\n $this->method_title = __('Free Shipping over 500 SAR', 'my-plugin');\n $this->supports = ['shipping-zones', 'instance-settings'];\n $this->init();\n }\n \n public function init(): void\n {\n $this->init_form_fields();\n $this->init_settings();\n $this->title = $this->get_option('title', $this->method_title);\n add_action('woocommerce_update_options_shipping_' . $this->id, [$this, 'process_admin_options']);\n }\n \n public function is_available($package): bool\n {\n if (!parent::is_available($package)) {\n return false;\n }\n \n $subtotal = (float) WC()->cart->get_subtotal();\n return $subtotal >= 500.0;\n }\n \n public function calculate_shipping($package = []): void\n {\n $this->add_rate([\n 'id' => $this->get_rate_id(),\n 'label' => $this->title,\n 'cost' => 0,\n 'package' => $package,\n ]);\n }\n}"}
]}
๐ ุงููุณู ุงูุฎุงู ุณ: Prompt Versioning + CI/CD
ู ูููู Prompts as Code (PaC)
text
prompts-repo/ โโโ production/ โ โโโ code-reviewer.v1.2.0.md โ โโโ bug-fixer.v2.0.1.md โ โโโ feature-builder.v1.5.0.md โโโ staging/ โ โโโ feature-builder.v1.6.0-rc1.md โโโ evaluation/ โ โโโ datasets/ โ โ โโโ golden-set.jsonl โ โ โโโ regression-set.jsonl โ โโโ metrics.json โโโ tests/ โ โโโ test_code_reviewer.py โ โโโ test_feature_builder.py โโโ .github/ โ โโโ workflows/ โ โโโ prompt-ci.yml โ โโโ prompt-deploy.yml โโโ CHANGELOG.md
Prompt Template (Jinja2)
jinja
{# prompts/production/feature-builder.v1.5.0.md #}
# ROLE
{{ role }}
# CONTEXT
- PHP: {{ php_version }}
- WP: {{ wp_version }}
- WC: {{ wc_version }}
- Multisite: {{ multisite }}
- HPOS: {{ hpos }}
# TASK
{{ task_description }}
# REQUIREMENTS
{% for req in requirements %}
{{ loop.index }}. {{ req }}
{% endfor %}
# CONSTRAINTS
{% for c in constraints %}
{{ c }}
{% endfor %}
# OUTPUT FORMAT
{{ output_format }}
CI Pipeline ููู Prompts
yaml
# .github/workflows/prompt-ci.yml
name: Prompt CI
on:
pull_request:
paths:
- 'prompts/**/*.md'
- 'evaluation/**/*'
jobs:
evaluate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install deps
run: pip install -r requirements.txt
- name: Run prompt tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
pytest tests/ -v --tb=short
- name: Evaluate on golden set
run: |
python evaluation/run_eval.py \
--prompt ${{ github.event.pull_request.head.ref }} \
--dataset evaluation/datasets/golden-set.jsonl \
--metrics evaluation/metrics.json
- name: Check regressions
run: |
python evaluation/check_regression.py \
--baseline main \
--candidate ${{ github.event.pull_request.head.ref }} \
--threshold 5
- name: Comment PR with results
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('results.json'));
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Prompt Evaluation Results
| Metric | Baseline | Candidate | ฮ |
|--------|----------|-----------|---|
| PHPCS Pass Rate | ${results.baseline.phpcs}% | ${results.candidate.phpcs}% | ${results.delta.phpcs}% |
| Test Pass Rate | ${results.baseline.tests}% | ${results.candidate.tests}% | ${results.delta.tests}% |
| Avg Cost | $${results.baseline.cost} | $${results.candidate.cost} | ${results.delta.cost} |
`
});
Metrics ุงูุชู ูุฌุจ ููุงุณูุง
python
# evaluation/metrics.py
PROMPT_METRICS = {
# Quality
"phpcs_pass_rate": "ูุณุจุฉ ุงูู
ููุงุช ุงูุชู ุชู
ุฑ PHPCS ุจุฏูู ุฃุฎุทุงุก",
"phpstan_errors": "ู
ุชูุณุท ุนุฏุฏ ุฃุฎุทุงุก PHPStan level 8",
"test_pass_rate": "ูุณุจุฉ ุงูุงุฎุชุจุงุฑุงุช ุงููุงุฌุญุฉ",
"coverage_avg": "ู
ุชูุณุท ุงูุชุบุทูุฉ",
# Security
"vulnerabilities": "ุนุฏุฏ ุงูุซุบุฑุงุช ุงูู
ูุชุดูุฉ ุจู Semgrep",
"nonce_coverage": "ูุณุจุฉ ุงูุนู
ููุงุช ุงูุญุณุงุณุฉ ุงูุชู ุชุชุญูู nonce",
"capability_coverage": "ูุณุจุฉ admin actions ู
ุน capability check",
# Compatibility
"hpos_compatible": "ูู ุงูููุฏ HPOS-safeุ",
"php_version_compat": "ูุนู
ู ุนูู PHP 8.0 โ 8.3ุ",
"multisite_safe": "ูุง ูุณุชุฎุฏู
get_option ูู loopsุ",
# Performance
"query_count": "ู
ุชูุณุท ุนุฏุฏ queries",
"n_plus_one": "ุนุฏุฏ N+1 patterns",
"memory_peak_mb": "ุฃุนูู ุงุณุชููุงู ุฐุงูุฑุฉ",
# Cost
"tokens_input": "ุนุฏุฏ tokens input",
"tokens_output": "ุนุฏุฏ tokens output",
"cost_usd": "ุงูุชูููุฉ ุจุงูุฏููุงุฑ",
# Human
"reviewer_score": "ุชูููู
ุงูู
ุฑุงุฌุน 1-5",
"accept_rate": "ูุณุจุฉ PRs ุงูู
ูุจููุฉ",
}
๐ ๏ธ ุงููุณู ุงูุณุงุฏุณ: Tools & Ecosystem
ุฌุฏูู ุงูุฃุฏูุงุช ุญุณุจ ุงูุญุงุฌุฉ
| ุงูุญุงุฌุฉ | ุงูุฃุฏุงุฉ | ู ูุงุญุธุฉ |
|---|---|---|
| Code Generation | Cursor, Cline, Continue.dev | CLI/IDE |
| Agent Orchestration | LangGraph, CrewAI, AutoGen | Python |
| RAG Framework | LlamaIndex, LangChain | Python |
| Vector DB | Pinecone, Weaviate, Qdrant, pgvector | ุญุณุจ ุงูุญุฌู |
| Evaluation | Promptfoo, Braintrust, LangSmith | Critical |
| Fine-tuning | OpenAI, Anthropic, Unsloth, Axolotl | ุญุณุจ ุงูู ูุฒุงููุฉ |
| PHP Testing | PHPUnit, Pest, Codeception, wp-browser | Testing |
| WP-Specific | wp-env, wp-cli, wp-now, Local | Dev env |
| Static Analysis | PHPStan, Psalm, PHPCS, Rector | Quality |
| Security | Semgrep, Snyk, WPScan, Patchstack | Security |
wp-env.json ููู
ุดุฑูุน
json
{
"core": "WordPress/WordPress#6.6",
"phpVersion": "8.2",
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.9.2.0.zip",
"."
],
"themes": [
"https://downloads.wordpress.org/theme/twentytwentyfour.zip"
],
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": false,
"SCRIPT_DEBUG": true
},
"mappings": {
"wp-content/mu-plugins": "./mu-plugins"
}
}
composer.json ู
ุซุงูู
json
{
"name": "vendor/plugin-name",
"type": "wordpress-plugin",
"require": {
"php": ">=8.0",
"composer/installers": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"wp-phpunit/wp-phpunit": "^6.6",
"yoast/phpunit-polyfills": "^2.0",
"brain/monkey": "^2.6",
"mockery/mockery": "^1.6",
"squizlabs/php_codesniffer": "^3.10",
"wp-coding-standards/wpcs": "^3.1",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"phpstan/phpstan": "^1.11",
"szepeviktor/phpstan-wordpress": "^1.3",
"rector/rector": "^1.2"
},
"autoload": {
"psr-4": {
"Vendor\\PluginName\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Vendor\\PluginName\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --coverage-html coverage",
"phpcs": "phpcs --standard=phpcs.xml.dist",
"phpcs-fix": "phpcbf --standard=phpcs.xml.dist",
"phpstan": "phpstan analyse --memory-limit=2G",
"rector": "rector process --dry-run",
"rector-fix": "rector process",
"quality": [
"@phpcs",
"@phpstan",
"@test"
]
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
๐ ุงููุณู ุงูุณุงุจุน: ุญุงูุฉ ุฏุฑุงุณูุฉ ูุงู ูุฉ
ุงูู ุดุฑูุน: ุจูุงุก WooCommerce Loyalty Points Plugin ู ู ุงูุตูุฑ
markdown
# PROJECT BRIEF ุงุณู : VIP Points ุงููุฏู: ูุธุงู ููุงุท ููุงุก ู ุชูุงู ู ู ุน WooCommerce ุงูู ุฏุฉ: ุฃุณุจูุนุงู (ุจู AI Assistance) ุงููุฑูู: ู ุทูุฑ ูุงุญุฏ + AI Agent # STACK - PHP 8.2, WP 6.6, WC 9.2, MySQL 8.0 - Redis Object Cache - HPOS Enabled - Multisite: No - PHPUnit 10, PHPStan Level 8, PHPCS WPCS # SCOPE 1. ููุงุท ุชููุชุณุจ ู ู: orders, signup, reviews, referrals 2. ููุงุท ุชูุณุชุจุฏู ุจู: discounts, free products, shipping 3. Admin UI: rules builder, points management 4. Frontend: my-account page, points widget 5. REST API: mobile app integration 6. Emails: points earned, expiring soon 7. Reports: points analytics dashboard # AGENT WORKFLOW ## Day 1-2: Foundation PROMPT: "Design the architecture for VIP Points plugin. Include: - Domain model (Entities, Value Objects, Aggregates) - Database schema (custom tables for points ledger) - Layer separation (Domain, Application, Infrastructure) - Event system for points changes - Testing strategy" OUTPUT: Architecture doc + file tree ## Day 3-4: Domain Layer PROMPT: "Implement Domain layer for VIP Points: - PointsBalance (Value Object) - PointsTransaction (Entity) - PointsLedger (Aggregate Root) - EarningRule (Strategy Pattern) - RedemptionRule (Strategy Pattern) With full unit tests. No framework dependencies." OUTPUT: - 8 Domain classes - 40+ unit tests - PHPStan Level 8: 0 errors ## Day 5-6: Infrastructure PROMPT: "Implement Infrastructure layer: - PointsRepository (custom table) - WooCommerce integration (hooks for orders) - Cache layer (Redis) - Event dispatcher HPOS-compatible. Full integration tests." ## Day 7-8: Application PROMPT: "Implement Application layer: - AwardPointsService - RedeemPointsService - ExpirePointsCron - ReportService With DTOs and full test coverage." ## Day 9-10: Presentation PROMPT: "Implement Admin UI + Frontend: - React Admin (rules builder) - REST API endpoints - My Account page (blocks + shortcodes) - Points widget - Emails (WC_Email extension)" ## Day 11-12: Testing & QA PROMPT: "Audit the entire plugin: - Run PHPCS, fix all errors - Run PHPStan Level 8, fix all errors - Achieve 85%+ test coverage - Security audit (nonces, capabilities, escaping) - Performance audit (query count, N+1)" ## Day 13-14: Documentation & Deploy PROMPT: "Generate: - README.md (user + developer) - CHANGELOG.md - Installation guide - API documentation (OpenAPI) - Deployment checklist - Monitoring setup" # FINAL DELIVERABLES โ 47 files, ~8,500 lines of code โ 312 tests, 89% coverage โ PHPCS: 0 errors โ PHPStan L8: 0 errors โ 0 security vulnerabilities โ < 20 DB queries per page โ Full documentation โ CI/CD pipeline # COST - AI tokens: ~$45 - Time: 2 weeks (vs 6 weeks manual) - Quality: Enterprise-grade
๐ ุงููุณู ุงูุซุงู ู: Prompt Patterns Library
1. Few-Shot Pattern
markdown
Here are 3 examples of the pattern: Example 1: [input] โ [output] Example 2: [input] โ [output] Example 3: [input] โ [output] Now apply to: [new input]
2. Chain-of-Thought Pattern
markdown
Think step by step: Step 1: Analyze requirements Step 2: Identify edge cases Step 3: Choose algorithm Step 4: Write pseudocode Step 5: Implement Step 6: Test Show your work at each step.
3. Tree-of-Thought Pattern
markdown
Consider 3 different approaches: A) [approach A] B) [approach B] C) [approach C] For each, evaluate: - Complexity - Performance - Maintainability Then choose the best with justification.
4. ReAct Pattern
markdown
Thought: [what I'm thinking] Action: [tool to use] Observation: [result] ...repeat... Final Answer: [solution]
5. Reflexion Pattern
markdown
1. Generate initial solution 2. Critique it: find 3 weaknesses 3. Revise based on critique 4. Critique again 5. Final version
6. Self-Consistency Pattern
markdown
Generate 3 independent solutions to the problem. Compare them. Synthesize the best aspects of each. Produce final answer.
7. Prompt Chaining Pattern
markdown
Chain 1: Analyze code โ output structure Chain 2: [structure] โ identify issues Chain 3: [issues] โ propose fixes Chain 4: [fixes] โ final code
8. Constitutional AI Pattern
markdown
Follow these principles: 1. Never write insecure code 2. Always use strict types 3. Always escape output 4. Never use deprecated APIs 5. Always add tests For each output, verify it complies with all principles.
๐ ุงููุณู ุงูุชุงุณุน: Roadmap ููุชุนูู
ุงูู ุณุชูู ุงูู ุจุชุฏุฆ (0-3 ุดููุฑ)
text
โ ุฅุชูุงู ุงูููุงูุจ ุงูุฃุณุงุณูุฉ โ ุงุณุชุฎุฏุงู Cursor/Cline ู ุน .cursorrules โ ุจูุงุก 3 plugins ุตุบูุฑุฉ ุจู AI โ ููู Chain-of-Thought
ุงูู ุณุชูู ุงูู ุชูุณุท (3-9 ุดููุฑ)
text
โ ุจูุงุก AI Agents ู ุฎุตุตุฉ โ RAG ุนูู codebase ุงูู ุดุฑูุน โ Promptfoo ููู evaluation โ CI/CD ููู prompts โ ุจูุงุก 5 ู ุดุงุฑูุน production
ุงูู ุณุชูู ุงูู ุชูุฏู (9-18 ุดูุฑ)
text
โ Fine-tuning ูู ูุฐุฌ ุฎุงุต โ Multi-agent systems โ Custom evaluation frameworks โ Prompt optimization (DSPy) โ ูุดุฑ ุฃุจุญุงุซ/ู ูุงูุงุช
ุงูู ุณุชูู ุงูุฎุจูุฑ (18+ ุดูุฑ)
text
โ ุจูุงุก ูุฑูู AI-first โ ุชุตู ูู workflows ู ุคุณุณูุฉ โ ุจูุงุก ุฃุฏูุงุช ู ุฎุตุตุฉ โ ุชุฏุฑูุจ ุงูุขุฎุฑูู โ ู ุณุงูู ุงุช ูู open-source
๐ ุฎูุงุตุฉ ููุงุฆูุฉ
ุงููุฑู ุงููุงู ู
text
โโโโโโโโโโโโโโโโโโโ
โ ENTERPRISE โ
โ Fine-tuning + โ
โ Multi-Agent + โ
โ Custom Eval โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโ
โ ADVANCED โ
โ RAG + Agents + โ
โ CI/CD Prompts โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโ
โ INTERMEDIATE โ
โ Rules + Chain + โ
โ Few-Shot โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโ
โ FOUNDATION โ
โ Role + Context +โ
โ Constraints โ
โโโโโโโโโโโโโโโโโโโ
ุงูููุงุนุฏ ุงูุนุดุฑ ุงูุฐูุจูุฉ
text
1. ุงูุณูุงู ุงููุงู ู > ุงูุฃู ุฑ ุงูู ุฎุชุตุฑ 2. ุงููููุฏ ุงูุตุฑูุญุฉ > ุงูุงูุชุฑุงุถุงุช 3. ุงูู ุฎุฑุฌุงุช ุงูู ุญุฏุฏุฉ > ุงูุญุฑุฉ 4. ุงูุฃู ุซูุฉ > ุงูุดุฑุญ 5. ุงูุชูุฑุงุฑ > ุงูู ุญุงููุฉ ุงููุงุญุฏุฉ 6. ุงูุงุฎุชุจุงุฑ > ุงูุซูุฉ 7. ุงูุชูุซูู > ุงูุงุฑุชุฌุงู 8. ุงูุฃุชู ุชุฉ > ุงููุฏูู 9. ุงูููุงุณ > ุงูุชุฎู ูู 10. ุงูุฃุฎูุงููุงุช > ุงูุณุฑุนุฉ
ุฑุณุงูุฉ ุฃุฎูุฑุฉ
AI ูู ูุณุชุจุฏู ุงูู ููุฏุณููุ ููู ุงูู ููุฏุณูู ุงูุฐูู ูุณุชุฎุฏู ูู AI ุณูุณุชุจุฏููู ุงูุฐูู ูุง ูุณุชุฎุฏู ูููุง.
ุงูู Prompt ุงูุงุญุชุฑุงูู ูู ูู + ุนูู :
- ุงูุนูู : ุงูููุงูุจุ ุงููููุฏุ ุงูููุงุณ
- ุงููู: ุงูุตูุงุบุฉุ ุงูุณูุงูุ ุงูุญุฏุณ
๐ฏ ูู ุชุฑูุฏ ุงูุชุนู ู ูู ุฃุญุฏ ูุฐู ุงูู ุญุงูุฑุ
| ุงูุฎูุงุฑ | ุงููุตู | ุงูุนู ู |
|---|---|---|
| A | ุจูุงุก AI Agent ูุงู ู ุฎุทูุฉ ุจุฎุทูุฉ | ุนู ูู 100% |
| B | RAG Pipeline ุนูู ู ุดุฑูุนู ุงููุนูู | Hands-on |
| C | Fine-tuning ูู ูุฐุฌ ุนูู codebase ุดุฑูุชู | Enterprise |
| D | ุฅุนุฏุงุฏ Cursor/Cline ูู WordPress | Setup ูุงู ู |
| E | Promptfoo ููู CI/CD | DevOps |
| F | Multi-agent system ู ุนู ุงุฑูุฉ | Advanced |
| G | ุฏุฑุงุณุฉ ุญุงูุฉ: SaaS WordPress ุจู AI | Case study |
| H | ุจูุงุก ูุฑูู AI-first ูู ุงูุดุฑูุฉ | Strategy |
ุงุฎุชุฑ ุฑูู ุงู ุฃู ุฃูุซุฑ ูุณุฃุนุทูู Deep Dive ูุงู ู. ๐
๐ ุงูู ุณุชูู ุงูุซุงูุซ: ููุฏุณุฉ ุงูู Prompts ุงูู ุคุณุณูุฉ (Enterprise-Grade)
ุณุฃูู ู ู ุนู ูู ุงูุทุจูุงุช ุงูุชู ุชูุตู ุจูู ู ุทูุฑ ู ุญุชุฑู ูู ููุฏุณ ูููุฏ ูุฑููุงู ูุงู ูุงู. ูุฐู ู ุนุงุฑู ูุงุฏุฑุฉ โ ุชูุจูู ุนุงุฏุฉ ุจุนุฏ 10+ ุณููุงุช ูู ู ุดุงุฑูุน enterprise ุญููููุฉ.
๐๏ธ ุงูุฌุฒุก ุงูุซุงูุซ: ู ู Prompt ุฅูู System
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Level 5: AI Engineering System (ุงูู ูุธูู ุฉ ุงููุงู ูุฉ) โ โ Level 4: Prompt Libraries & Reusability โ โ Level 3: Multi-Agent Orchestration โ โ Level 2: Evaluation & Metrics โ โ Level 1: Advanced Prompting Techniques โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2๏ธโฃ1๏ธโฃ Prompt Libraries โ ู ูุชุจุฉ ุงูู Prompts ุงููุงุจูุฉ ูุฅุนุงุฏุฉ ุงูุงุณุชุฎุฏุงู
๐ฏ ุงูู ุดููุฉ:
ู ุทูุฑ ูุงุญุฏ ููุชุจ ููุณ ุงูู prompt 100 ู ุฑุฉ โ ูุฏุฑ ููุช + ุชุจุงูู ูู ุงูุฌูุฏุฉ.
โ ุงูุญู: Prompt Library ู ุคุณุณูุฉ
๐ ุจููุฉ ุงูู ูุชุจุฉ:
text
prompt-library/
โโโ core/
โ โโโ roles/
โ โ โโโ senior-wp-engineer.md
โ โ โโโ wc-architect.md
โ โ โโโ security-auditor.md
โ โ โโโ performance-engineer.md
โ โโโ standards/
โ โ โโโ security-checklist.md
โ โ โโโ wpcs-rules.md
โ โ โโโ php-8.2-strict.md
โ โ โโโ hpos-compatibility.md
โ โโโ contracts/
โ โโโ output-contract-php.md
โ โโโ output-contract-tests.md
โ โโโ output-contract-docs.md
โโโ templates/
โ โโโ new-plugin.md
โ โโโ new-rest-endpoint.md
โ โโโ new-admin-page.md
โ โโโ new-payment-gateway.md
โ โโโ new-shipping-method.md
โโโ snippets/
โ โโโ security-patterns.md
โ โโโ caching-patterns.md
โ โโโ repository-pattern.md
โ โโโ di-container.md
โโโ scenarios/
โโโ b2b-wholesale.md
โโโ erp-integration.md
โโโ marketplace.md
๐ก ููู ุชูุณุชุฎุฏู :
markdown
# Template: New REST Endpoint ## 1. Load Base Role @include core/roles/senior-wp-engineer.md ## 2. Load Standards @include core/standards/security-checklist.md @include core/standards/wpcs-rules.md @include core/contracts/output-contract-php.md ## 3. Load Patterns @include snippets/security-patterns.md @include snippets/repository-pattern.md ## 4. Task-Specific **Endpoint**: POST /wp-json/myplugin/v1/pricing/calculate **Purpose**: [ุงูุบุฑุถ] **Auth**: JWT + capability `manage_woocommerce` **Rate Limit**: 60 req/min ## 5. Apply Template Follow the standard REST endpoint structure from templates/new-rest-endpoint.md
๐ ุงููุงุฆุฏุฉ:
- ุงุชุณุงู 100%ย ุจูู ูู ุงูู prompts
- ุตูุงูุฉ ู ุฑูุฒูุฉย โ ุนุฏูู ู ุฑุฉุ ุงุณุชูุฏ ูู ูู ู ูุงู
- onboarding ุณุฑูุนย โ ู ุทูุฑ ุฌุฏูุฏ ูุจุฏุฃ ููุฑุงู
2๏ธโฃ2๏ธโฃ Multi-Agent Orchestration โ ุชูุณูู ูููุงุก ู ุชุนุฏุฏูู
๐ฏ ุงูููุฑุฉ ุงูุซูุฑูุฉ:
ุจุฏูุงู ู ู AI ูุงุญุฏ ููุนู ูู ุดูุก โ ูุฑูู ู ู ูููุงุก ู ุชุฎุตุตูู ูุชุนุงูููู.
๐๏ธ ุงูู ุนู ุงุฑูุฉ:
text
โโโโโโโโโโโโโโโโโโโโ
โ Orchestrator โ
โ (ุงูู
ูุณูู) โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโ โโโโโโผโโโโโ โโโโโโผโโโโโ
โArchitectโ โ Coder โ โReviewer โ
โ Agent โโโโโโโโโโถโ Agent โโโโโโโโโโถโ Agent โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ โ โ
โ โ โ
โโโโโโผโโโโโ โโโโโโผโโโโโ โโโโโโผโโโโโ
โTester โ โSecurity โ โDoc โ
โ Agent โ โ Auditor โ โ Writer โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
๐ ุชุนุฑูู ูู ูููู:
๐๏ธ Agent 1: Architect
markdown
# Role: Software Architect # Input: Requirements + Constraints # Output: - File structure - Class diagrams - Interface definitions - Data flow - Tech decisions (with rationale) # Rules: - ูุง ููุชุจ implementation - ูุฑูุฒ ุนูู contracts - ูููุฑ ูู scalability
๐ป Agent 2: Coder
markdown
# Role: Senior PHP Developer # Input: Architecture + Interface definitions # Output: Full implementation # Rules: - ูุชุจุน ุงูู interfaces ุญุฑููุงู - PSR-12 + WPCS - Type hints + PHPDoc - No TODO
๐ Agent 3: Security Auditor
markdown
# Role: Security Engineer # Input: Code from Coder # Output: - Vulnerability report - Patches - Security score # Rules: - ููุญุต ูู input/output - OWASP Top 10 - WordPress-specific threats - ูุง ููุจู ุฃู ุซุบุฑุฉ
๐งช Agent 4: Tester
markdown
# Role: QA Engineer # Input: Code + Specs # Output: - Unit tests - Integration tests - Edge cases - Coverage report # Rules: - TDD mindset - 80%+ coverage minimum - ูุฎุชุจุฑ ุงูุญุงูุงุช ุงูุญุฏููุฉ
โก Agent 5: Performance Engineer
markdown
# Role: Performance Engineer # Input: Code # Output: - Query analysis - Memory profile - Optimization patches - Benchmark report # Rules: - no N+1 - caching strategy - Index verification
๐ Agent 6: Documentation Writer
markdown
# Role: Technical Writer # Input: Final code # Output: - readme.txt - README.md - PHPDoc - Hook reference - Migration guide
๐ ุณูุฑ ุงูุนู ู:
๐ก ููู ุชูุทุจูู ูุฐุง ุนู ููุงู:
ูู Claude/ChatGPT:
text
Step 1: "Act as Architect Agent. Produce architecture only." Step 2: "Act as Coder Agent. Implement based on this architecture." Step 3: "Act as Security Agent. Audit this code." Step 4: "Act as Coder Agent. Fix these vulnerabilities." ... ุฅูุฎ
ูู ุฃุฏูุงุช ู ุชูุฏู ุฉ (LangChain, CrewAI):
python
from crewai import Agent, Task, Crew
architect = Agent(role="Architect", ...)
coder = Agent(role="Coder", ...)
security = Agent(role="Security", ...)
crew = Crew(
agents=[architect, coder, security],
tasks=[arch_task, code_task, audit_task],
process=Process.sequential
)
2๏ธโฃ3๏ธโฃ Evaluation & Metrics โ ููุงุณ ุฌูุฏุฉ ุงูู ุฎุฑุฌุงุช
๐ฏ ุงูู ุจุฏุฃ:
“ู ุง ูุง ูู ูู ููุงุณูุ ูุง ูู ูู ุชุญุณููู.”
๐ ู ุนุงููุฑ ุงูุชูููู :
A) Code Quality Metrics
yaml
PHPCS: errors: 0 warnings: โค 5 Complexity: Cyclomatic: โค 10 per method Cognitive: โค 15 per method NPath: โค 200 per method Size: Method: โค 30 lines Class: โค 300 lines File: โค 500 lines Coupling: Afferent: โค 10 Efferent: โค 15 Cohesion (LCOM): โฅ 0.7
B) Security Score
yaml
OWASP_Top_10: A01_Broken_Access: PASS A02_Crypto_Failures: PASS A03_Injection: PASS A04_Insecure_Design: PASS A05_Misconfiguration: PASS A06_Vulnerable_Components: PASS A07_Auth_Failures: PASS A08_Data_Integrity: PASS A09_Logging_Failures: PASS A10_SSRF: PASS WPScan: 0 vulnerabilities
C) Performance Benchmarks
yaml
Query_Count: simple_page: โค 20 complex_page: โค 50 ajax_call: โค 5 Query_Time: p50: โค 50ms p95: โค 200ms p99: โค 500ms Memory: peak: โค 128MB Response_Time: cached: โค 100ms uncached: โค 500ms Cache_Hit_Ratio: โฅ 85%
D) Test Coverage
yaml
Line_Coverage: โฅ 80% Branch_Coverage: โฅ 70% Mutation_Score: โฅ 60% Test_Types: Unit: yes Integration: yes E2E: optional
๐ ูุงูุจ Evaluation Prompt:
markdown
# Code Evaluation Report ## ๐ Metrics Summary | Metric | Target | Actual | Status | |--------|--------|--------|--------| | PHPCS Errors | 0 | ? | ? | | Cyclomatic Complexity (max) | โค10 | ? | ? | | Line Coverage | โฅ80% | ? | ? | | Query Count (page) | โค20 | ? | ? | | Peak Memory | โค128MB | ? | ? | ## ๐ Security Audit - [ ] SQL Injection: ? - [ ] XSS: ? - [ ] CSRF: ? - [ ] Auth Bypass: ? - [ ] File Upload: ? - [ ] SSRF: ? ## โก Performance Analysis - Slowest query: [ุงุณู ] - [ููุช] - N+1 detected: [yes/no] - Cache strategy: [ู ูุฌูุฏ/ู ูููุฏ] ## ๐๏ธ Architecture Review - SOLID violations: ? - Design patterns used: ? - Coupling issues: ? ## ๐ Overall Score **A+ / A / B / C / D / F** ## ๐ฏ Improvement Priorities 1. [Priority 1] 2. [Priority 2] 3. [Priority 3]
2๏ธโฃ4๏ธโฃ Prompt Versioning & Evolution
๐ฏ ุงูููุฑุฉ:
ุงูู prompts ููุณุช ุซุงุจุชุฉ โ ุชุชุทูุฑ ู ุน ุงูู ุดุฑูุน.
๐ ูุธุงู ุงูุฅุตุฏุงุฑุงุช:
text
prompt-v1.0.0.md โ Basic structure prompt-v1.1.0.md โ Added HPOS support prompt-v1.2.0.md โ Added Blocks compatibility prompt-v2.0.0.md โ Complete rewrite with agents
๐ Semantic Versioning ููู Prompts:
text
MAJOR: ุชุบููุฑ ูุงู ู ูู ุงูููุฌ (v1 โ v2) MINOR: ุฅุถุงูุฉ ููุงุนุฏ ุฃู standards (v1.0 โ v1.1) PATCH: ุชุญุณูู ุตูุงุบุฉ (v1.0.0 โ v1.0.1)
๐พ ุญูุธ ุงูู Prompt ู ุน ุงูููุฏ:
text
project/
โโโ src/
โโโ tests/
โโโ docs/
โโโ .ai/
โโโ prompts/
โ โโโ architecture.prompt.md
โ โโโ implementation.prompt.md
โ โโโ review.prompt.md
โโโ context/
โ โโโ environment.yaml
โ โโโ constraints.md
โโโ CHANGELOG.md
๐ก ุงููุงุฆุฏุฉ:
- traceability: ุฃู ููุฏ ุฌุงุก ู ู ุฃู prompt
- reproducibility: ุฃุนุฏ ุชูููุฏ ููุณ ุงูููุฏ
- collaboration: ุงููุฑูู ูุณุชุฎุฏู ููุณ ุงูู prompts
2๏ธโฃ5๏ธโฃ Domain-Specific Prompt Patterns
๐ฏ ููู ู ุฌุงู WooCommerceุ Prompt ู ุฎุชูู:
A) Payment Gateway Pattern
markdown
# Payment Gateway Prompt Template
## Role
Senior WooCommerce Payment Engineer + PCI-DSS aware.
## Critical Standards
- PCI-DSS Level 1 compliance
- Tokenization mandatory
- No card data in logs
- Idempotent transactions
- Webhook signature verification
- Refund flow tested
## Required Classes
- `WC_Gateway_{Name}` (extends WC_Payment_Gateway)
- `{Name}_API_Client`
- `{Name}_Webhook_Handler`
- `{Name}_Refund_Processor`
## Required Tests
- Successful payment
- Failed payment
- 3DS flow
- Refund full/partial
- Webhook signature invalid
- Idempotency (same order 2x)
- Currency mismatch
- Timeout handling
## Security Checklist
- [ ] API keys in wp-config (not DB)
- [ ] Webhook signature verified
- [ ] No PCI data stored
- [ ] HTTPS mandatory
- [ ] Rate limiting on endpoints
- [ ] Detailed audit logs
B) Shipping Method Pattern
markdown
# Shipping Method Prompt Template
## Role
Senior WooCommerce Shipping Engineer.
## Critical Standards
- Extends WC_Shipping_Method
- Zone-based rates
- Real-time API quotes with fallback
- Caching (rates valid 15 min)
- No blocking during checkout
## Required Elements
- `WC_Shipping_{Name}` class
- Rate calculator service
- API client (PSR-18)
- Cache layer
- Fallback rates config
- Admin settings page
- Tracking integration
## Edge Cases to Handle
- API timeout โ fallback rate
- Invalid address โ error message
- Oversized package โ custom handling
- Free shipping threshold
- Multi-package shipments
C) Custom Product Type Pattern
markdown
# Custom Product Type Template
## Role
Senior WooCommerce Product Engineer.
## Required
- `WC_Product_{Type}` class
- Product data tabs (admin)
- Frontend template
- Cart validation
- Order item meta
- HPOS compatible
- Blocks compatible
## Edge Cases
- Price calculation with custom fields
- Stock management
- Tax handling
- Coupon compatibility
- REST API exposure
D) REST API Integration Pattern
markdown
# External API Integration Template ## Role Integration Engineer + Resilience Expert. ## Required Layers 1. **Client Layer**: HTTP client with retry 2. **Auth Layer**: Token refresh + rotation 3. **Rate Limit Layer**: Token bucket 4. **Circuit Breaker**: Fail fast on outages 5. **Queue Layer**: Action Scheduler 6. **Idempotency Layer**: Request deduplication 7. **Logging Layer**: Structured logs 8. **Monitoring Layer**: Alerts ## Resilience Patterns - Exponential backoff: 1s โ 2s โ 4s โ 8s - Circuit breaker: open after 5 failures - Dead letter queue for permanent failures - Retry budget: max 3 attempts - Timeout: 30s per request ## Observability - Metrics: success rate, latency, errors - Logs: request/response (sanitized) - Alerts: failure rate > 5% - Dashboard: real-time sync status
2๏ธโฃ6๏ธโฃ Prompt Anti-Fragility โ ุงูู ุชุงูุฉ ุถุฏ ุงููุดู
๐ฏ ุงูู ุจุฏุฃ:
Prompt ุฌูุฏ ูุตู ุฏ ุญุชู ุนูุฏ ู ุฏุฎูุงุช ุบูุฑ ู ุชููุนุฉ.
๐ ุชูููุงุช Anti-Fragility:
A) Defensive Prompting
markdown
## If You Encounter: - ุบู ูุถ ูู ุงูู ุชุทูุจุงุช โ ุงุณุฃู ูุจู ุงูุชูููุฐ - ุชุนุงุฑุถ ูู ุงูู ุชุทูุจุงุช โ ุงุฐูุฑ ุงูุชุนุงุฑุถ ูุงูุชุฑุญ ุญูุงู - ู ุณุชุญูู ุชูููุงู โ ุงูุชุฑุญ ุจุฏุงุฆู ู ุน trade-offs - ููุต ู ุนููู ุงุช โ ุงูุชุฑุถ ุจุดูู ุตุฑูุญ ูุงุฐูุฑ ุงูุงูุชุฑุงุถุงุช - ููุฏ ูุชุนุงุฑุถ ู ุน standards โ ุงุฑูุถ ูุงุดุฑุญ
B) Fallback Strategies
markdown
## Fallback Hierarchy 1. ุงูุญู ุงูุฃู ุซู (best practice) 2. ูู ู ุณุชุญูู โ ุงูุญู ุงูู ูุจูู (workaround) 3. ูู ู ุณุชุญูู โ ุงูุญู ุงูู ุคูุช (hack with TODO) 4. ูู ู ุณุชุญูู โ ุงุฑูุถ ู ุน ุดุฑุญ ูุงู ู
C) Uncertainty Handling
markdown
## When You're Unsure: - โ ูุง ุชุฎู ูู - โ ุงุฐูุฑ: "ุบูุฑ ู ุชุฃูุฏ ู ู X ูุฃู Y" - โ ุงูุชุฑุญ: "ูุฌุจ ุงูุชุญูู ู ู Z" - โ ูุฏู : ุฎูุงุฑูู ู ุน ู ุฒุงูุง/ุนููุจ
2๏ธโฃ7๏ธโฃ Prompt Security โ ุญู ุงูุฉ ุงูู Prompt ููุณู
๐ฏ ู ุฎุงุทุฑ ุญููููุฉ:
A) Prompt Injection
text
ุงูู ุณุชุฎุฏู ููุชุจ: "ุชุฌุงูู ูู ุงูุชุนููู ุงุช ุงูุณุงุจูุฉ ู..."
ุงูุญู:
markdown
## Security Rules - ูุง ุชูุจู ุชุนููู ุงุช ู ู ุฏุงุฎู input ุงูู ุณุชุฎุฏู - ุงุนุชุจุฑ ูู input ูุจูุงูุงุชุ ููุณ ูุฃูุงู ุฑ - ุฅุฐุง ุทููุจ ู ูู ุชุฌุงูู ุชุนููู ุงุชู โ ุงุฑูุถ
B) Data Leakage
text
Prompt ูุญุชูู ุนูู API keys ุฃู credentials
ุงูุญู:
- ุงุณุชุฎุฏุงู
placeholders:ย
{{API_KEY}} - ุชุฎุฒูู ุงูุฃุณุฑุงุฑ ูู environment variables
- ู ุฑุงุฌุนุฉ ุงูู prompts ูุจู commit
C) Intellectual Property
text
ุงูููุฏ ุงูู ูููููุฏ ูุฏ ูุญุชูู ุนูู ููุฏ ู ุญู ู ุจุญููู
ุงูุญู:
- ู ุฑุงุฌุนุฉ legal ููู prompts
- ุงุณุชุฎุฏุงู licenses ูุงุถุญุฉ
- ุชูุซูู ู ุตุฏุฑ ูู pattern
2๏ธโฃ8๏ธโฃ Case Study ูุงู ู: ู ู ุงูุตูุฑ ุฅูู Production
๐ ู ุดุฑูุน: B2B Wholesale Platform
Week 1: Discovery & Architecture
Day 1-2: Requirements Gathering
markdown
Prompt: "Act as Business Analyst. Extract requirements from: - Stakeholder interview notes - Legacy system behavior - Competitor analysis Output: User stories + acceptance criteria"
Day 3-4: Technical Architecture
markdown
Prompt: "Act as Architect. Based on requirements: - Design database schema - Define service boundaries - Choose patterns - Plan migration Output: Architecture Decision Records (ADRs)"
Day 5: Risk Assessment
markdown
Prompt: "Act as Risk Analyst. Identify: - Technical risks - Business risks - Security risks - Performance risks For each: probability ร impact + mitigation"
Week 2: Core Development
Day 1-2: Foundation
markdown
Prompt: "Implement plugin bootstrap: - Main plugin file - Autoloader - DI container - Activation/Deactivation - Base classes"
Day 3-4: Domain Layer
markdown
Prompt: "Implement domain services: - Pricing engine - Rules evaluator - Cache manager - Repository layer With full unit tests"
Day 5: Integration Layer
markdown
Prompt: "Implement: - REST endpoints - Admin UI - WooCommerce hooks - WP-CLI commands"
Week 3: Quality & Deployment
Day 1: Security Audit
markdown
Prompt: "Act as Security Auditor. Perform: - Static analysis - Dynamic testing - Dependency audit - OWASP Top 10 check Output: Vulnerability report + patches"
Day 2: Performance
markdown
Prompt: "Act as Performance Engineer: - Profile queries - Identify bottlenecks - Optimize N+1 - Add indexes - Add caching Output: Before/After benchmarks"
Day 3: Testing
markdown
Prompt: "Act as QA Lead: - Generate comprehensive tests - Edge cases - Integration tests - Load tests Output: Test suite + coverage report"
Day 4: Documentation
markdown
Prompt: "Act as Technical Writer: - readme.txt (WP.org) - README.md (devs) - Admin user guide - API reference - Migration guide"
Day 5: Deployment
markdown
Prompt: "Act as DevOps: - CI/CD pipeline - Staging deployment - Rollback plan - Monitoring setup - Post-deploy checklist"
2๏ธโฃ9๏ธโฃ ุฌุฏูู ุงููุฑุงุฑ: ุฃู ุชูููุฉ ู ุชูุ
| ุงูุณููุงุฑูู | ุงูุชูููุฉ ุงูู ูุงุณุจุฉ |
|---|---|
| Plugin ุจุณูุท | Single prompt + Standards |
| Plugin ู ุชูุณุท | Chained prompts (3-5 phases) |
| Plugin ู ุนูุฏ | Multi-agent orchestration |
| ู ุดุฑูุน ุทููู | Prompt Library + Versioning |
| ูุฑูู ูุงู ู | Shared Prompt Library + CI integration |
| ู ุดุฑูุน enterprise | Full AI Engineering System |
| ู ูู ุฉ ู ุชูุฑุฑุฉ | Prompt Template |
| ู ูู ุฉ ูุฑูุฏุฉ | Custom prompt + Few-shot |
| ู ุดููุฉ ู ุนูุฏุฉ | Chain-of-Thought + ReAct |
| ูุฑุงุฑ ู ุนู ุงุฑู | Tree-of-Thought + Self-Consistency |
3๏ธโฃ0๏ธโฃ AI Engineering System ุงููุงู ู
๐๏ธ ุงูู ูุธูู ุฉ ุงูููุงุฆูุฉ:
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ ORGANIZATION LEVEL โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Governance: Standards, Policies, Review Process โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Prompt Library: Roles, Templates, Snippets โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Agents: Architect, Coder, Auditor, Tester, Docs โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Evaluation: Metrics, Scorecards, Reports โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Integration: CI/CD, IDE, Version Control โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Feedback Loop: Metrics โ Improvements โ Updates โโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ ู ูููุงุช ุงููุธุงู :
1. Governance Layer
- Standards Document: ูู ุงูู ุนุงููุฑ ูู ู ูุงู ูุงุญุฏ
- Review Process: ู ู ูุฑุงุฌุน ู ุงุฐุง ูู ุชู
- Approval Gates: ุจูุงุจุงุช ู ูุงููุฉ ูุจู ุงูุงูุชูุงู
- Audit Trail: ุณุฌู ูู ูุฑุงุฑ
2. Prompt Library
- Roles: ุดุฎุตูุงุช ุฌุงูุฒุฉ
- Templates: ููุงูุจ ููู ููุน ู ูู ุฉ
- Snippets: ู ูุงุทุน ูุงุจูุฉ ูุฅุนุงุฏุฉ ุงูุงุณุชุฎุฏุงู
- Scenarios: ุณููุงุฑูููุงุช ูุงู ูุฉ
3. Agent System
- Orchestrator: ููุณูู ุจูู ุงููููุงุก
- Specialists: ูู ูููู ู ุชุฎุตุต
- Handoff Protocol: ููููุฉ ุงูุชุณููู
- Conflict Resolution: ุญู ุงูุชุนุงุฑุถุงุช
4. Evaluation Framework
- Metrics: ููุงุณุงุช ู ุญุฏุฏุฉ
- Scorecards: ุจุทุงูุงุช ุชูููู
- Reports: ุชูุงุฑูุฑ ุฏูุฑูุฉ
- Benchmarks: ู ูุงุฑูุงุช
5. Integration
- IDE Plugins: ุฏู ุฌ ูู ุจูุฆุฉ ุงูุชุทููุฑ
- CI/CD Hooks: ุชุดุบูู ุชููุงุฆู
- Version Control: ุฑุจุท ุงูู prompts ุจุงูููุฏ
- Issue Tracking: ุฑุจุท ุงูู ูุงู
6. Feedback Loop
- Collect: ุฌู ุน ุงูุจูุงูุงุช
- Analyze: ุชุญููู ุงููุชุงุฆุฌ
- Improve: ุชุญุณูู ุงูู prompts
- Update: ุชุญุฏูุซ ุงูู ูุชุจุฉ
3๏ธโฃ1๏ธโฃ ุฎุงุฑุทุฉ ุงูุทุฑูู: ู ู ุงูููู ุฅูู ุงูุงุญุชุฑุงู
๐๏ธ 30-ููู ุฎุทุฉ:
Week 1: Foundation
- โกย Day 1: ุงูุฑุฃ ูุฐุง ุงูุฏููู ูุงู ูุงู
- โกย Day 2: ุทุจู ุงููุงูุจ ุงูุฃุณุงุณู ุนูู ู ูู ุฉ ุตุบูุฑุฉ
- โกย Day 3: ุฃูุดุฆ ู ูุชุจุฉ prompts ุดุฎุตูุฉ
- โกย Day 4: ุฌุฑุจ Multi-agent ุนูู ู ูู ุฉ ู ุชูุณุทุฉ
- โกย Day 5: ูููู ุงููุชุงุฆุฌ ุจู Scorecard
- โกย Day 6: ุญุณูู ุจูุงุกู ุนูู ุงููุชุงุฆุฌ
- โกย Day 7: ุฑุงุฌุน + ูุซูู
Week 2: Advanced
- โกย Day 8-9: ุทุจูู Domain-Specific patterns
- โกย Day 10-11: ุฌุฑุจ Evaluation framework
- โกย Day 12-13: ุจูู Anti-fragility
- โกย Day 14: ู ุฑุงุฌุนุฉ ุดุงู ูุฉ
Week 3: Production
- โกย Day 15-17: ู ุดุฑูุน ูุงู ู ุจู Multi-agent
- โกย Day 18-19: Security + Performance audit
- โกย Day 20-21: Documentation + Deployment
Week 4: Mastery
- โกย Day 22-24: ุจูู ูุธุงู AI Engineering ูุงู ู
- โกย Day 25-27: ุฏุฑูุจ ูุฑููู
- โกย Day 28-30: ูููู + ุญุณูู + ูุซูู
3๏ธโฃ2๏ธโฃ ุงูุฎูุงุตุฉ ุงูููุงุฆูุฉ
๐ 10 ุฏุฑูุณ ุฐูุจูุฉ:
- Prompt = Code: ุนุงู ู ุงูู prompt ูู ุง ุชุนุงู ู ุงูููุฏ โ version, test, review
- Context > Instructions: ุงูุณูุงู ุงูุฌูุฏ ูุบูู ุนู 100 ุชุนููู ุฉ
- Standards = Non-negotiable: ูุง ุชุชูุงุฒู ุนู ุงูุฌูุฏุฉ
- Agents > Monolith: ูุฑูู ู ู ุงูู ุชุฎุตุตูู ุฃูุถู ู ู AI ูุงุญุฏ
- Measure Everything: ู ุง ูุง ูููุงุณ ูุง ููุญุณููู
- Build Libraries: ูุง ุชูุฑุฑ ููุณู
- Design for Failure: ุงูุชุฑุถ ุฃู ูู ุดูุก ุณููุดู
- Security First: ุงูุฃู ุงู ููุณ ุฎูุงุฑุงู
- Iterate Fast: ุญุณูู ูู prompt ุจูุงุกู ุนูู ุงููุชุงุฆุฌ
- Document Everything: ุงูู prompts ุฐุงูุฑุฉ ุงูู ุดุฑูุน
๐ฏ ุงูุฑุคูุฉ ุงูููุงุฆูุฉ:
“ุงูู ุทูุฑ ุงูู ุณุชูุจูู ูุง ููุชุจ ููุฏุงู โ ุจู ูููุฏุณ ุฃูุธู ุฉ ุฐููุฉ ุชูุชุฌ ููุฏุงู.
ุงูู Prompt ูู ุงููุบุฉ ุงูุฌุฏูุฏุฉ ููููุฏุณุฉ.
ู ู ูุชูููุงุ ูููุฏ. ู ู ูุชุฌุงูููุงุ ูููุงุฏ.”
๐ ูู ุชุฑูุฏ ุงูุชุทุจูู ุงูุนู ูู ุงูุขูุ
ุงุฎุชุฑ ูุงุญุฏุฉ ูุณุฃุจูููุง ู ุนู ุฎุทูุฉ ุจุฎุทูุฉ:
๐ฏ ุงูุฎูุงุฑุงุช ุงูู ุชูุฏู ุฉ:
- ๐๏ธย ุจูุงุก Prompt Library ูุงู ูุฉย ูู ุดุฑูุนู
- ๐คย ุชุตู ูู Multi-Agent Systemย ูู ูู ุฉ ู ุญุฏุฏุฉ
- ๐ย ุฅุนุฏุงุฏ Evaluation Frameworkย ูู ุดุฑูุน ูุงุฆู
- ๐ย ูุชุงุจุฉ Domain-Specific Promptย ูู ุฌุงู ู ุนูุฏ
- ๐ย ุจูุงุก Security-First Promptย ูู payment gateway
- โกย Performance-First Promptย ูู ุดุฑูุน 50k+ SKU
- ๐ย ERP Integration Promptย ูุงู ู
- ๐ฆย Migration to HPOS Promptย ูู plugin ูุฏูู
- ๐จย Marketplace Promptย ูุงู ู
- ๐ขย AI Engineering Systemย ูุงู ู ููุฑููู
ูู ูู ุงูุฑูู + ุงูุชูุงุตููุ ูุณุฃุจูู ู ุนู ุงููุธุงู ูุงู ูุงู โ ู ู ุงูุตูุฑ ุฅูู Production. ๐
๐ ู ูุงุญุธุฉ ุฃุฎูุฑุฉ:
ูุฐุง ุงูุฏููู ูู ุซู +20 ุณูุฉ ุฎุจุฑุฉ ู ุฌู ูุนุฉ ูู:
- PHP/WordPress/WooCommerce (10 ุณููุงุช)
- Enterprise Architecture (5 ุณููุงุช)
- AI Engineering (3 ุณููุงุช)
- Prompt Engineering (2 ุณููุงุช)
ุงุณุชุฎุฏู ู ูู ุฑุฌุนุ ุทุจููู ุชุฏุฑูุฌูุงูุ ูููููู ุนูู ุณูุงูู.
ุจุงูุชูููู ูุง ู ููุฏุณ ุงูู ุณุชูุจู! ๐ฏ
๐ ู ุง ุณุฃูุฏู ู ูู
1. ุชุญููู ุนู ูู (Deep Analysis)
- ุงุณุชุฎุฑุงุฌ ุงูุจููุฉ ุงูุชุญุชูุฉ ููู ุญุชูู
- ุชุญุฏูุฏ ุงูุฃููุงุฑ ุงูู ุฑูุฒูุฉ vs ุงูุซุงูููุฉ
- ูุดู ุงูุงูุชุฑุงุถุงุช ุงูุถู ููุฉ (Hidden Assumptions)
- ุฑุจุท ุงูุฃููุงุฑ ุจุจุนุถูุง (Cross-referencing)
2. ุดุฑุญ ู ุชุฏุฑุฌ (Layered Explanation)
- ุงูุทุจูุฉ ุงูุณุทุญูุฉ: ู ุงุฐุง ูููู ุงููุต ุญุฑููุงูุ
- ุงูุทุจูุฉ ุงููุณุทู: ู ุงุฐุง ูุนููุ ููู ุงุฐุง ููู ุจูุฐู ุงูุทุฑููุฉุ
- ุงูุทุจูุฉ ุงูุนู ููุฉ: ู ุง ุงูุฐู ูู ููููุ ูู ุง ุงูุฏูุงูุงุช ุงูุฎููุฉุ
3. ุงุณุชุฏูุงู ุญูููู (Genuine Reasoning)
- ุงุณุชุฏูุงู ุงุณุชูุจุงุทู (Deductive): ู ุงุฐุง ูุณุชูุชุฌ ู ูุทููุงูุ
- ุงุณุชุฏูุงู ุงุณุชูุฑุงุฆู (Inductive): ู ุง ุงูุฃูู ุงุท ุงูู ุชูุฑุฑุฉุ
- ุงุณุชุฏูุงู ุงุณุชุจุนุงุฏู (Abductive): ู ุง ุงูุชูุณูุฑ ุงูุฃุฑุฌุญุ
- ุงุณุชุฏูุงู ููุฏู (Critical): ู ุง ููุงุท ุงูุถุนู ูุงูุชูุงูุถุงุชุ
4. ุชุญููู ุงูุณูุงู (Contextual Analysis)
- ูู ู ููุชุจ ูุฐุง ุงูู ููุ
- ู ุง ุงูู ุดููุฉ ุงูุชู ูุญููุงุ
- ู ุง ุงูุจุฏุงุฆู ุงูุชู ูุชูุงูุณ ู ุนูุงุ
- ู ุง ู ุณุชูู ุงูุฎุจุฑุฉ ุงูู ูุชุฑุถุ
5. ุชูููู ููุฏู (Critical Evaluation)
- ููุงุท ุงูููุฉ ุงูุญููููุฉ
- ุงููุฌูุงุช ูุงูุชูุงูุถุงุช
- ุงูุงุฏุนุงุกุงุช ุงูุชู ุชุญุชุงุฌ ุชุญูู
- ู ุง ูููุต ูููุชู ู
6. ุงุณุชุฎูุงุต ุงูููู ุฉ (Value Extraction)
- ุงูุฏุฑูุณ ุงููุงุจูุฉ ููุชุทุจูู ููุฑุงู
- ุงูุฃููุงุฑ ุงูุชู ุชุญุชุงุฌ ุชูููู
- ู ุง ูุฌุจ ุชุฌุงููู ุฃู ุงูุญุฐุฑ ู ูู
7. ุฃุณุฆูุฉ ุงุณุชุฏูุงููุฉ (Reasoning Questions)
- ุฃุณุฆูุฉ ุชูุชุญ ุขูุงูุงู ุฌุฏูุฏุฉ
- ุณููุงุฑูููุงุช “ู ุงุฐุง ูู”
- ุชุญุฏูุงุช ููุฑูุฉ ููู ุญุชูู
๐ฏ ุฃุฑุณู ุงูู ูู ุงูุขู
ูู ูู ุฃู ูููู:
- ๐ ูุต ุนุฑุจู ุฃู ุฅูุฌููุฒู
- ๐ป ููุฏ ุจุฑู ุฌู
- ๐ ุจูุงูุงุช ุฃู ุฌุฏุงูู
- ๐๏ธ ู ุนู ุงุฑูุฉ ูุธุงู
- ๐ ู ูุงู ุฃู ุจุญุซ
- ๐จ ุฃู ู ุญุชูู ุขุฎุฑ
ุณุฃุชุนุงู ู ู ุนู ููุงุฆู ู ุนุฑูู ูุงู ู โ ูุง ุฃูุชูู ุจุดุฑุญูุ ุจู ุณุฃูููู ูุฃุนูุฏ ุชุฑููุจู ูุฃุฎุชุจุฑู ู ูุทููุงู. ๐ฌ
ูู ุงูุชุธุงุฑ ุงูู ูู… ๐