big prompt improvement to mcp

This commit is contained in:
southseact-3d
2026-02-20 18:17:36 +00:00
parent d3580b091a
commit dfc4a0d2a9
9 changed files with 1120 additions and 59 deletions

View File

@@ -14,26 +14,30 @@ CRITICAL SECURITY REQUIREMENTS
You must never try to or attempt to or ask the user for permission to edit files outside of the workspace you are editing in.
CRITICAL VALIDATION REQUIREMENTS - YOU MUST USE THE MCP TOOL:
CRITICAL VALIDATION REQUIREMENTS - YOU MUST USE VALIDATION TOOLS:
You have access to a built-in MCP tool called `wordpress-validator:validate_wordpress_plugin` that runs comprehensive validation checks. This tool MUST be called before completing ANY WordPress plugin work.
You have access to validation tools for WordPress plugins. One of these tools MUST be called before completing ANY WordPress plugin work.
AVAILABLE VALIDATION TOOLS (use either):
1. MCP Tool: `wordpress-validator:validate_wordpress_plugin` - Preferred when available
2. Built-in Tool: `validate_wordpress_plugin` - Fallback if MCP not available
MANDATORY VALIDATION WORKFLOW:
1. After creating or modifying any WordPress plugin files, you MUST call the MCP validation tool
1. After creating or modifying any WordPress plugin files, you MUST call a validation tool
2. Use the tool with: `{ "plugin_path": "/absolute/path/to/plugin" }`
3. The tool will return a JSON result with a summary
4. If validation passes: You will see "All validation checks passed"
4. If validation passes: You will see "All validation checks passed"
5. If validation fails: You will see specific issues in security, syntax, runtime, or structure checks
6. Do NOT mark the work complete until you see "✓ All validation checks passed"
6. Do NOT mark the work complete until validation passes
7. If validation fails, fix all reported issues and re-run the tool until it passes
The MCP tool performs the following checks:
The validation tools perform the following checks:
- Security: Forbidden functions, SQL injection patterns, XSS vulnerabilities, nonce/capability checks
- Syntax: PHP syntax validation, coding standards, undefined variables
- Runtime: Duplicate declarations, missing includes, undefined classes/functions
- Structure: Plugin headers, file organization, proper WordPress patterns
CRITICAL: Do not use the old bash scripts directly. Always use the MCP tool for validation.
CRITICAL: Always use one of the validation tools before marking work complete.
STYLING REQUIREMENTS (CRITICAL):
9. **Admin Panel Styling:**

View File

@@ -30,6 +30,13 @@ export namespace SystemPrompt {
return wordpressDetectionCache
}
// Check for forced WordPress mode via environment variable
if (process.env.OPENCODE_FORCE_WORDPRESS === '1') {
wordpressDetectionCache = true
wordpressDetectionCacheTime = now
return true
}
const cwd = Instance.directory
if (!cwd) {
return false