Files
APAW/.kilo/commands/wordpress.md
¨NW¨ b46a1a20a8 feat: add PHP development stack, atomic tasks, modular code rules, agent monitoring, fix target project detection
7 evolutionary tasks implemented:

1. PHP web development: php-developer agent + 6 skills (Laravel, Symfony, WordPress, security, testing, modular architecture) + 2 pipeline commands (/laravel, /wordpress)

2. Atomic task decomposition: 1 action = 1 task rule, task sizing guide, decomposition protocol for orchestrator, token budgets per complexity

3. Modular code rules: max 100 lines/file, max 30 lines/function, service/repository patterns, cross-module communication via events only

4. Gitea-centric workflow: mandatory issue creation before work, research with links, progress checkboxes, screenshots on test, git history as knowledge base

5. Fix: target project auto-detection — removed all hardcoded UniqueSoft/APAW from API calls, added get_target_repo() via git remote, GITEA_TARGET_REPO env override

6. Agent execution monitoring: agent-executions.jsonl logging, agent-stats.ts statistics script, required fields per invocation, Gitea comment includes duration/tokens

7. Token optimization: 1 action = 1 task principle, token budgets by task type, routing matrix, no scope creep, skip unnecessary pipeline steps
2026-04-18 23:43:04 +01:00

131 lines
3.2 KiB
Markdown

---
description: WordPress site or plugin development pipeline with modern patterns
mode: wordpress
model: ollama-cloud/qwen3-coder:480b
variant: thinking
color: "#21759B"
permission:
read: allow
edit: allow
write: allow
bash: allow
glob: allow
grep: allow
task:
"*": deny
"php-developer": allow
"system-analyst": allow
"lead-developer": allow
"sdet-engineer": allow
"code-skeptic": allow
"the-fixer": allow
"frontend-developer": allow
"devops-engineer": allow
"release-manager": allow
"security-auditor": allow
"orchestrator": allow
---
# WordPress Development Pipeline
Create a WordPress site, theme, or plugin following modern PHP patterns with namespacing, strict types, and modular architecture.
## Parameters
- `project_name`: Plugin or theme name (required)
- `type`: 'plugin', 'theme', 'site' (default: 'plugin')
- `wp_version`: WordPress version (default: '6.5')
- `docker`: Create Docker deployment (default: true)
- `issue`: Gitea issue number for tracking (required)
## Overview
```
Requirements → Architecture → Setup → Custom Types → REST API → Frontend → Tests → Docker
```
## Atomic Task Decomposition
Each step is exactly ONE atomic task per agent invocation.
### Step 1: Requirements (1 task)
**Agent**: `@requirement-refiner`
- Create issue in TARGET PROJECT (not APAW)
- Define user stories and acceptance criteria
### Step 2: Architecture (1 task)
**Agent**: `@system-analyst`
- Define data model
- Design REST API endpoints
- Plan custom post types and taxonomies
### Step 3: Plugin/Theme Setup (1 task)
**Agent**: `@php-developer`
For plugin:
```
{project_name}/
├── {project_name}.php # Main plugin file
├── composer.json
├── includes/
│ ├── Admin/
│ ├── Frontend/
│ ├── REST/
│ ├── PostTypes/
│ ├── Taxonomies/
│ └── Utils/
├── assets/
└── languages/
```
### Step 4: Custom Post Types (1 task per CPT)
**Agent**: `@php-developer` (ONE invocation per CPT)
- Register custom post type with labels and supports
- Register custom meta fields with `show_in_rest`
- Create CPT factory for testing
### Step 5: REST API Controllers (1 task per resource)
**Agent**: `@php-developer` (ONE invocation per controller)
- Extend `WP_REST_Controller`
- Implement CRUD operations
- Add permission callbacks
- Input sanitization and validation
### Step 6: Frontend (1 task per component)
**Agent**: `@frontend-developer`
- Gutenberg blocks or Vue.js components
- Admin pages with React/Vue
- Frontend templates
### Step 7: Tests (1 task per test file)
**Agent**: `@sdet-engineer`
- PHPUnit tests for services
- WP_REST_Server integration tests
- E2E tests for critical flows
### Step 8: Review → Security → Docker → Release
Same pattern as Laravel pipeline.
## Quality Gates
| Gate | Criteria |
|------|----------|
| Setup | Plugin activates without errors |
| CPTs | `show_in_rest` works, API returns data |
| API | All endpoints return correct responses |
| Auth | Permission checks work |
| Security | Nonce verification, input sanitization |
| Tests | PHPUnit passes |
| Docker | Containers build and run |