fix: renumber agents — 00_intake stays 00, others shift +1

00_auditor -> 01_auditor
01_ceo     -> 02_ceo
02_product_manager -> 03_product_manager
03_architect       -> 04_architect
04_dev_backend     -> 05_dev_backend
05_dev_frontend    -> 06_dev_frontend
06_qa_engineer     -> 07_qa_engineer
07_visual_qa       -> 08_visual_qa
08_devops_security -> 09_devops_security
09_tech_writer     -> 10_tech_writer
10_deploy          -> 11_deploy
11_seo_content     -> 12_seo_content

Update all references in AGENCY.md, state.json, backlog.json
This commit is contained in:
parsa aghaei 2026-07-26 17:34:50 +03:30
parent f437f46e2e
commit 5e8a919dd0
15 changed files with 219 additions and 85 deletions

View File

@ -67,7 +67,7 @@ You WILL run out of context mid-task. This is handled.
## PIPELINE A — New Project (GREENFIELD)
```
00_intake → 01_ceo → 02_product_manager → 03_architect → [TASK LOOP] → 10_deploy
00_intake → 01_auditor → 02_ceo → 03_product_manager → 04_architect → [TASK LOOP] → 11_deploy
```
---
@ -81,19 +81,19 @@ This is the most powerful mode. When user wants to improve, update, or fix an ex
Run ALL review agents in sequence. Each agent reads the project and writes findings ONLY:
```
00_auditor → specs/reviews/code_health_review.md
04_dev_backend → specs/reviews/backend_review.md (review mode)
05_dev_frontend → specs/reviews/frontend_review.md (review mode)
11_seo_content → specs/reviews/seo_content_review.md (review mode)
08_devops_security → specs/reviews/security_review.md (review mode)
07_visual_qa → specs/reviews/ux_review.md (review mode)
01_auditor → specs/reviews/code_health_review.md
05_dev_backend → specs/reviews/backend_review.md (review mode)
06_dev_frontend → specs/reviews/frontend_review.md (review mode)
12_seo_content → specs/reviews/seo_content_review.md (review mode)
09_devops_security → specs/reviews/security_review.md (review mode)
08_visual_qa → specs/reviews/ux_review.md (review mode)
```
Track progress in `state.json > review_phase`:
```json
"review_phase": {
"active": true,
"queue": ["00_auditor", "04_dev_backend", "05_dev_frontend", "11_seo_content", "08_devops_security", "07_visual_qa"],
"queue": ["01_auditor", "05_dev_backend", "06_dev_frontend", "12_seo_content", "09_devops_security", "08_visual_qa"],
"completed": [],
"findings_dir": ".ai_agency/specs/reviews/"
}
@ -152,29 +152,29 @@ Find first task in backlog where:
Route by assigned_role:
"04_dev_backend":
04_dev_backend → 06_qa_engineer
PASS → 08_devops_security → 09_tech_writer
FAIL → 04_dev_backend (max 3 retries, then BLOCKED_NEEDS_HUMAN)
"05_dev_backend":
05_dev_backend → 07_qa_engineer
PASS → 09_devops_security → 10_tech_writer
FAIL → 05_dev_backend (max 3 retries, then BLOCKED_NEEDS_HUMAN)
"05_dev_frontend":
05_dev_frontend → 06_qa_engineer → 07_visual_qa
PASS → 08_devops_security → 09_tech_writer
FAIL → 05_dev_frontend (max 3 retries)
"06_dev_frontend":
06_dev_frontend → 07_qa_engineer → 08_visual_qa
PASS → 09_devops_security → 10_tech_writer
FAIL → 06_dev_frontend (max 3 retries)
"11_seo_content":
11_seo_content → 09_tech_writer
"12_seo_content":
12_seo_content → 10_tech_writer
(no QA needed — content review is self-contained)
"06_qa_engineer": (standalone test tasks)
06_qa_engineer → 08_devops_security → 09_tech_writer
"07_qa_engineer": (standalone test tasks)
07_qa_engineer → 09_devops_security → 10_tech_writer
"08_devops_security": (standalone DevOps tasks)
08_devops_security → 09_tech_writer
"09_devops_security": (standalone DevOps tasks)
09_devops_security → 10_tech_writer
09_tech_writer:
10_tech_writer:
→ IF pending tasks remain: pick next task → route to its agent
→ IF ALL tasks done: → 10_deploy → COMPLETE
→ IF ALL tasks done: → 11_deploy → COMPLETE
```
---
@ -241,18 +241,18 @@ Alert if same agent runs >10 times on same ticket (possible infinite loop).
| Agent | Role | When Called |
|-------|------|-------------|
| `00_intake` | Requirements & intent gathering | Start of any pipeline |
| `00_auditor` | Code health audit | Brownfield init OR Review Phase |
| `01_ceo` | Strategic direction | After intake |
| `02_product_manager` | Backlog creation / synthesis | After strategy / after review phase |
| `03_architect` | Tech stack & API design | Before execution |
| `04_dev_backend` | Backend implementation / code review | Tasks + Review Phase |
| `05_dev_frontend` | Frontend implementation / code review | Tasks + Review Phase |
| `06_qa_engineer` | Automated testing | After each dev task |
| `07_visual_qa` | UX & visual review | After frontend tasks + Review Phase |
| `08_devops_security` | Security & DevOps / security review | After QA + Review Phase |
| `09_tech_writer` | Docs + backlog routing | After each completed task |
| `10_deploy` | Production deployment | When all tasks done |
| `11_seo_content` | SEO analysis + real content writing | Review Phase + Content tasks |
| `01_auditor` | Code health audit | Brownfield init OR Review Phase |
| `02_ceo` | Strategic direction | After intake |
| `03_product_manager` | Backlog creation / synthesis | After strategy / after review phase |
| `04_architect` | Tech stack & API design | Before execution |
| `05_dev_backend` | Backend implementation / code review | Tasks + Review Phase |
| `06_dev_frontend` | Frontend implementation / code review | Tasks + Review Phase |
| `07_qa_engineer` | Automated testing | After each dev task |
| `08_visual_qa` | UX & visual review | After frontend tasks + Review Phase |
| `09_devops_security` | Security & DevOps / security review | After QA + Review Phase |
| `10_tech_writer` | Docs + backlog routing | After each completed task |
| `11_deploy` | Production deployment | When all tasks done |
| `12_seo_content` | SEO analysis + real content writing | Review Phase + Content tasks |
---

View File

@ -5,7 +5,7 @@
"title": "Prisma Schema & Database Indexing Optimization (PostgreSQL)",
"description": "Add indexes on high-traffic search fields (categorySlug, suitableFor) in Product model. Validate B2B/Wholesale field relations.",
"architectural_layer": "data_persistence",
"assigned_role": "04_dev_backend",
"assigned_role": "05_dev_backend",
"priority": "HIGH",
"status": "completed",
"max_files_allowed": 2,
@ -16,9 +16,24 @@
"اعتبارسنجی ارجاعات ریلیشن‌ها و پشتیبانی متوازن از فیلدهای B2B/Wholesale"
],
"sub_steps": [
{ "index": 1, "name": "read_schema", "description": "Read existing Prisma schema", "status": "done" },
{ "index": 2, "name": "add_indexes", "description": "Add @@index directives on search fields", "status": "done" },
{ "index": 3, "name": "validate_relations", "description": "Validate B2B relation integrity", "status": "done" }
{
"index": 1,
"name": "read_schema",
"description": "Read existing Prisma schema",
"status": "done"
},
{
"index": 2,
"name": "add_indexes",
"description": "Add @@index directives on search fields",
"status": "done"
},
{
"index": 3,
"name": "validate_relations",
"description": "Validate B2B relation integrity",
"status": "done"
}
]
},
{
@ -26,20 +41,37 @@
"title": "Seed Data & Official Catalog Sync in Prisma (backend/prisma/seed.ts)",
"description": "Write complete seed.ts with 30 official Canina Germany catalog products including exact retail and wholesale prices. Must run via 'npx prisma db seed' without errors.",
"architectural_layer": "data_persistence",
"assigned_role": "04_dev_backend",
"assigned_role": "05_dev_backend",
"priority": "HIGH",
"status": "pending",
"max_files_allowed": 2,
"estimated_minutes": 25,
"dependency_task_ids": ["TASK-101"],
"dependency_task_ids": [
"TASK-101"
],
"acceptance_criteria": [
"همگام‌سازی کامل ۳۰ محصول کاتالوگ رسمی Canina آلمان با قیمت‌های دقیق تک‌فروشی و قیمت عمده همکار",
"اجرای موفقیت‌آمیز npx prisma db seed بدون خطا"
],
"sub_steps": [
{ "index": 1, "name": "analyze_schema", "description": "Read schema.prisma Product model for all required fields", "status": "pending" },
{ "index": 2, "name": "write_seed_data", "description": "Write 30 Canina catalog products with retail+wholesale prices", "status": "pending" },
{ "index": 3, "name": "verify_seed_runs", "description": "Run npx prisma db seed and fix any errors", "status": "pending" }
{
"index": 1,
"name": "analyze_schema",
"description": "Read schema.prisma Product model for all required fields",
"status": "pending"
},
{
"index": 2,
"name": "write_seed_data",
"description": "Write 30 Canina catalog products with retail+wholesale prices",
"status": "pending"
},
{
"index": 3,
"name": "verify_seed_runs",
"description": "Run npx prisma db seed and fix any errors",
"status": "pending"
}
]
},
{
@ -47,20 +79,37 @@
"title": "NestJS Global DTO Validation Pipes & Sanitization (backend/src/main.ts)",
"description": "Enable global ValidationPipe with whitelist and forbidNonWhitelisted. Set up Global Exception Filter for standard API error response structure.",
"architectural_layer": "transport_api",
"assigned_role": "04_dev_backend",
"assigned_role": "05_dev_backend",
"priority": "HIGH",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 15,
"dependency_task_ids": ["TASK-102"],
"dependency_task_ids": [
"TASK-102"
],
"acceptance_criteria": [
"فعال‌سازی ValidationPipe سراسری با whitelist و forbidNonWhitelisted",
"تنظیم Global Exception Filter برای ساختار استاندارد پاسخ به خطاهای API"
],
"sub_steps": [
{ "index": 1, "name": "configure_validation_pipe", "description": "Add global ValidationPipe to main.ts bootstrap", "status": "pending" },
{ "index": 2, "name": "create_exception_filter", "description": "Create HttpExceptionFilter class with standardized error response", "status": "pending" },
{ "index": 3, "name": "register_global_filter", "description": "Register exception filter globally in main.ts", "status": "pending" }
{
"index": 1,
"name": "configure_validation_pipe",
"description": "Add global ValidationPipe to main.ts bootstrap",
"status": "pending"
},
{
"index": 2,
"name": "create_exception_filter",
"description": "Create HttpExceptionFilter class with standardized error response",
"status": "pending"
},
{
"index": 3,
"name": "register_global_filter",
"description": "Register exception filter globally in main.ts",
"status": "pending"
}
]
},
{
@ -68,20 +117,37 @@
"title": "NestJS Auth & B2B Wholesale Role Guard Verification (backend/src/auth)",
"description": "Implement RolesGuard for User_Wholesale and ADMIN roles. Hide wholesale prices in product service when guard fails.",
"architectural_layer": "business_logic",
"assigned_role": "04_dev_backend",
"assigned_role": "05_dev_backend",
"priority": "HIGH",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 20,
"dependency_task_ids": ["TASK-103"],
"dependency_task_ids": [
"TASK-103"
],
"acceptance_criteria": [
"پیاده‌سازی گارد دسترسی RolesGuard برای نقش‌های User_Wholesale و ADMIN",
"مخفی‌سازی قیمت عمده در سرویس محصولات در صورت عدم تایید گارد احراز هویت"
],
"sub_steps": [
{ "index": 1, "name": "create_roles_guard", "description": "Create RolesGuard decorator and guard class", "status": "pending" },
{ "index": 2, "name": "apply_to_product_service", "description": "Conditionally return wholesalePrice based on user role", "status": "pending" },
{ "index": 3, "name": "write_guard_tests", "description": "Write Jest tests for RolesGuard with mock user contexts", "status": "pending" }
{
"index": 1,
"name": "create_roles_guard",
"description": "Create RolesGuard decorator and guard class",
"status": "pending"
},
{
"index": 2,
"name": "apply_to_product_service",
"description": "Conditionally return wholesalePrice based on user role",
"status": "pending"
},
{
"index": 3,
"name": "write_guard_tests",
"description": "Write Jest tests for RolesGuard with mock user contexts",
"status": "pending"
}
]
},
{
@ -89,20 +155,37 @@
"title": "NestJS Admin Orders & B2B Document Approval Service (backend/src/admin)",
"description": "Create service for approving business license documents to upgrade user role to User_Wholesale. Implement controllers for bulk order status and invoice export.",
"architectural_layer": "business_logic",
"assigned_role": "04_dev_backend",
"assigned_role": "05_dev_backend",
"priority": "HIGH",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 20,
"dependency_task_ids": ["TASK-104"],
"dependency_task_ids": [
"TASK-104"
],
"acceptance_criteria": [
"ایجاد سرویس تایید مدارک و پروانه کسب خریداران عمده جهت تغییر نقش به User_Wholesale",
"پیاده‌سازی کنترلرهای تغییر وضعیت سفارشات عمده و صادرات فاکتور"
],
"sub_steps": [
{ "index": 1, "name": "create_admin_module", "description": "Create NestJS AdminModule with controller and service", "status": "pending" },
{ "index": 2, "name": "implement_approval_service", "description": "Write document approval logic and role upgrade flow", "status": "pending" },
{ "index": 3, "name": "implement_order_controllers", "description": "Write bulk order status change and invoice export endpoints", "status": "pending" }
{
"index": 1,
"name": "create_admin_module",
"description": "Create NestJS AdminModule with controller and service",
"status": "pending"
},
{
"index": 2,
"name": "implement_approval_service",
"description": "Write document approval logic and role upgrade flow",
"status": "pending"
},
{
"index": 3,
"name": "implement_order_controllers",
"description": "Write bulk order status change and invoice export endpoints",
"status": "pending"
}
]
},
{
@ -110,20 +193,37 @@
"title": "Backend Unit & Integration Test Suite (Jest)",
"description": "Write unit tests for Auth and Products controllers. Ensure >80% code coverage for core backend services.",
"architectural_layer": "testing",
"assigned_role": "06_qa_engineer",
"assigned_role": "07_qa_engineer",
"priority": "HIGH",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 20,
"dependency_task_ids": ["TASK-105"],
"dependency_task_ids": [
"TASK-105"
],
"acceptance_criteria": [
"نوشتن تست‌های واحد کنترلرهای Auth و Products با Jest",
"تضمین درصد پوشش تست (Code Coverage) بالای ۸۰٪ برای سرویس‌های اصلی بک‌اند"
],
"sub_steps": [
{ "index": 1, "name": "write_auth_tests", "description": "Write Jest tests for AuthController covering login/logout/register", "status": "pending" },
{ "index": 2, "name": "write_product_tests", "description": "Write Jest tests for ProductsController with B2B price visibility tests", "status": "pending" },
{ "index": 3, "name": "verify_coverage", "description": "Run coverage report and ensure >80% for core services", "status": "pending" }
{
"index": 1,
"name": "write_auth_tests",
"description": "Write Jest tests for AuthController covering login/logout/register",
"status": "pending"
},
{
"index": 2,
"name": "write_product_tests",
"description": "Write Jest tests for ProductsController with B2B price visibility tests",
"status": "pending"
},
{
"index": 3,
"name": "verify_coverage",
"description": "Run coverage report and ensure >80% for core services",
"status": "pending"
}
]
},
{
@ -131,20 +231,37 @@
"title": "Frontend Error Boundaries & Global Loading Skeletal Streaming",
"description": "Strengthen ErrorBoundary in ProductPage and B2BPortal. Add streaming skeletons for better UX.",
"architectural_layer": "presentation_ui",
"assigned_role": "05_dev_frontend",
"assigned_role": "06_dev_frontend",
"priority": "MEDIUM",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 15,
"dependency_task_ids": ["TASK-106"],
"dependency_task_ids": [
"TASK-106"
],
"acceptance_criteria": [
"تقویت ErrorBoundary در لایه‌های حساس مانند ProductPage و B2BPortal",
"ارتقای تجربه کاربری با اسکلتون‌های استریمینگ متوازن"
],
"sub_steps": [
{ "index": 1, "name": "create_error_boundary", "description": "Create or improve ErrorBoundary component", "status": "pending" },
{ "index": 2, "name": "create_skeletons", "description": "Create ProductSkeleton and B2BPortalSkeleton components", "status": "pending" },
{ "index": 3, "name": "integrate_into_pages", "description": "Wrap ProductPage and B2BPortal with ErrorBoundary and Suspense", "status": "pending" }
{
"index": 1,
"name": "create_error_boundary",
"description": "Create or improve ErrorBoundary component",
"status": "pending"
},
{
"index": 2,
"name": "create_skeletons",
"description": "Create ProductSkeleton and B2BPortalSkeleton components",
"status": "pending"
},
{
"index": 3,
"name": "integrate_into_pages",
"description": "Wrap ProductPage and B2BPortal with ErrorBoundary and Suspense",
"status": "pending"
}
]
},
{
@ -152,20 +269,37 @@
"title": "B2B Wholesale Matrix & Prescription Direct Quick Order Optimization",
"description": "Connect B2B portal to backend auth service. Optimize bulk order registration with 30% discount for approved wholesalers.",
"architectural_layer": "presentation_ui",
"assigned_role": "05_dev_frontend",
"assigned_role": "06_dev_frontend",
"priority": "MEDIUM",
"status": "pending",
"max_files_allowed": 3,
"estimated_minutes": 20,
"dependency_task_ids": ["TASK-107"],
"dependency_task_ids": [
"TASK-107"
],
"acceptance_criteria": [
"ارتباط آنی پورتال B2B به سرویس احراز هویت بک‌اند",
"بهینه‌سازی ثبت سفارشات حجمی (Bulk Order) با تخفیف ۳۰٪ برای همکاران تاییدشده"
],
"sub_steps": [
{ "index": 1, "name": "connect_b2b_auth", "description": "Wire B2BPortal to backend auth API for role verification", "status": "pending" },
{ "index": 2, "name": "implement_bulk_order", "description": "Build bulk order form with quantity matrix and auto-discount calculation", "status": "pending" },
{ "index": 3, "name": "write_component_tests", "description": "Write tests for wholesale discount logic", "status": "pending" }
{
"index": 1,
"name": "connect_b2b_auth",
"description": "Wire B2BPortal to backend auth API for role verification",
"status": "pending"
},
{
"index": 2,
"name": "implement_bulk_order",
"description": "Build bulk order form with quantity matrix and auto-discount calculation",
"status": "pending"
},
{
"index": 3,
"name": "write_component_tests",
"description": "Write tests for wholesale discount logic",
"status": "pending"
}
]
}
],
@ -177,4 +311,4 @@
"generated_at": "2026-07-26T13:20:00Z",
"decomposition_pass": 1
}
}
}

View File

@ -5,7 +5,7 @@
"project_mode": "BROWNFIELD",
"status": "IN_PROGRESS",
"checkpoint": {
"active_agent": "04_dev_backend",
"active_agent": "05_dev_backend",
"current_ticket_id": "TASK-102",
"sub_step": {
"index": 1,
@ -40,17 +40,17 @@
"blocking_reason": null,
"agent_visit_counts": {
"00_intake": 1,
"00_auditor": 1,
"01_ceo": 1,
"02_product_manager": 1,
"03_architect": 1,
"04_dev_backend": 1
"01_auditor": 1,
"02_ceo": 1,
"03_product_manager": 1,
"04_architect": 1,
"05_dev_backend": 1
}
},
"agent_call_log": [
{ "agent": "00_auditor", "result": "health_score_audited", "timestamp": "2026-07-26T13:10:00Z" },
{ "agent": "02_product_manager", "result": "backlog_generated_8_tasks", "timestamp": "2026-07-26T13:15:00Z" },
{ "agent": "04_dev_backend", "result": "TASK-101_completed", "timestamp": "2026-07-26T16:20:00Z" }
{ "agent": "01_auditor", "result": "health_score_audited", "timestamp": "2026-07-26T13:10:00Z" },
{ "agent": "03_product_manager", "result": "backlog_generated_8_tasks", "timestamp": "2026-07-26T13:15:00Z" },
{ "agent": "05_dev_backend", "result": "TASK-101_completed", "timestamp": "2026-07-26T16:20:00Z" }
],
"last_updated": "2026-07-26T16:47:00Z"
}