PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
(claude-5-opus)
Token size
1,851
Example input
[Describe the software project]: E-commerce Inventory Management Microservice for multi-tenant SaaS platform with real-time stock synchronization across multiple warehouse locations and third-party fulfillment partners [What needs to be built or improved?]: Build a REST API service that handles inventory updates, manages low-stock alerts, prevents overselling across warehouses, and integrates with existing order management system via event streaming [Upload / repository structure / existing code]: Greenfield microservice; existing order management system uses PostgreSQL + RabbitMQ; no legacy inventory code to migrate [Available coding, testing, review, debugging, documentation agents]: Architect Agent (system design), Coding Agent (implementation), Testing Agent (unit + integration tests), Debugging Agent (failure investigation), Review Agent (code quality), Security Agent (auth + data protection), Documentation Agent (API docs + setup guides) [Expected features / Quality Standards / Deployment Requirements]: Production-ready API with 95%+ test coverage; OpenAPI specification; deployment guide for Kubernetes; monitoring/alerting rules; no breaking changes to order service contract; documentation for third-party integrations
Example output
## πŸ§ͺ TEST EXECUTION ### Phase 1 β€” Project Decomposition β€’ **Epic 1**: Core Inventory Operations - Feature 1a: Stock level management (create, update, query, delete) - Feature 1b: Multi-location inventory tracking - Feature 1c: Real-time low-stock alerts β€’ **Epic 2**: Synchronization & Integration - Feature 2a: Event-driven updates from order service - Feature 2b: Third-party warehouse sync via REST webhooks - Feature 2c: Event publishing for downstream consumers β€’ **Epic 3**: Safety & Compliance - Feature 3a: Prevent overselling (concurrent request handling) - Feature 3b: Audit logging for all inventory changes - Feature 3c: Role-based access control (warehouse manager, admin) β€’ **Dependencies**: Feature 1a must complete before 1b; Feature 1c depends on Redis cache; Feature 2a blocks Feature 2c; Feature 3a requires 1a + 1b completion β€’ **Parallel Opportunities**: Feature 1a and 3b can start simultaneously; Feature 2b parallel to 1c; Security implementation (3a, 3b, 3c) can parallel to core coding --- ### Phase 2 β€” Agent Role Assignment β€’ **Architect Agent** - Responsibility: Design database schema, API endpoints, event flow, caching strategy, disaster recovery - Inputs: Requirements, tech stack, constraints - Outputs: Architecture decision record, ER diagram, API spec draft, event schema, deployment architecture - Completion Criteria: All design docs reviewed by tech lead; no unresolved dependency conflicts β€’ **Coding Agent** - Responsibility: Implement Features 1a, 1b, 1c per architecture; write production code only; flag blockers - Inputs: Architecture docs, acceptance criteria, API spec - Outputs: Implemented routes, database models, business logic; no code review yet - Completion Criteria: All acceptance criteria met; no linting errors; code compiles; manual smoke tests pass β€’ **Testing Agent** - Responsibility: Write unit tests (business logic), integration tests (database + cache), API tests (route contracts) - Inputs: Implemented code, acceptance criteria, edge cases doc - Outputs: Test suite with 95%+ coverage; test execution reports; failure analysis - Completion Criteria: All tests passing; coverage meets threshold; test report uploaded β€’ **Debugging Agent** - Responsibility: Investigate test failures; reproduce issues; identify root cause; work with Coding Agent on fixes - Inputs: Failed test evidence, code changes, logs - Outputs: Root cause analysis, recommended fix, regression test cases - Completion Criteria: Issue reproduced; root cause confirmed (not hypothesis); fix validated with regression tests β€’ **Review Agent** - Responsibility: Assess code correctness, architecture alignment, readability, security posture, error handling - Inputs: Implemented code, architecture docs, code review checklist - Outputs: Review findings with severity levels; approve/request changes decision - Completion Criteria: All critical/high findings resolved; code meets style guide; design patterns applied correctly β€’ **Security Agent** - Responsibility: Verify authentication, authorization, data protection, input validation, secrets management - Inputs: Code, API spec, threat model, compliance requirements - Outputs: Security findings, pen-test results, policy compliance assessment - Completion Criteria: No critical vulnerabilities; encryption standards met; audit logging complete β€’ **Documentation Agent** - Responsibility: Write API documentation, setup guides, deployment playbooks, troubleshooting guides - Inputs: Final code, architecture decisions, deployment config, test results - Outputs: Updated README, OpenAPI spec, deployment guide, operations runbook - Completion Criteria: Documentation matches actual implementation; all endpoints documented; examples provided --- ### Phase 3 β€” Orchestration Workflow β€’ **Day 1-2**: Architect Agent produces architecture review β†’ Tech lead approval gate (PASS/BLOCK) β€’ **Day 3-8**: Parallel execution: - **Track A** (Coding): Coding Agent implements 1a β†’ Testing Agent writes tests β†’ Debugging Agent available for failures - **Track B** (Security): Security Agent implements auth/RBAC β†’ Coding Agent integrates findings β†’ Review Agent validates - **Track C** (Integration): Coding Agent implements 2a + 2c events β†’ Testing Agent validates event contracts β€’ **Day 9-10**: Code Review β€” Review Agent audits all code β†’ Conditional approval gate β€’ **Day 11**: Debugging + regression testing for any findings β€’ **Day 12**: Security sweep + pen-testing feedback β€’ **Day 13-14**: Documentation finalization + UAT + deployment β€’ **Handoff Format per Phase**: - From Architect β†’ Coding: [Architecture doc, accepted design decisions, identified risks, blocked items] - From Coding β†’ Testing: [Code commit hash, feature branch, acceptance criteria checklist, known limitations] - From Testing β†’ Debugging: [Failed test name, expected vs actual, environment details, logs, reproducibility steps] - From Debugging β†’ Coding: [Root cause analysis, recommended fix, regression test cases, severity level] --- ### Phase 4 β€” Shared Context (Handoff #1: Architect β†’ Coding) β€’ **Database Schema Context**: PostgreSQL with tables [inventory_items, warehouse_locations, inventory_movements (audit log), low_stock_alerts]; soft deletes on items; inventory_movements immutable β€’ **API Contract Context**: Endpoints designed around warehouse-scoped operations; pagination required for list endpoints; timestamps in UTC; all responses include request-id for tracing β€’ **Event Schema Context**: OrderCreated events trigger inventory reservations; InventoryUpdated events published on every stock change; schema versioned for backwards compatibility β€’ **Architecture Decisions Context**: Using optimistic locking for concurrent updates (version field); Redis caching for stock levels with 5-min TTL; event-sourcing pattern for audit trail β€’ **Known Risks Context**: Race conditions possible under high concurrency; third-party webhook delays could cause stale sync; database connection pooling needs tuning for load --- ### Phase 5 β€” Coding Workflow (Task: Implement Feature 1a β€” Stock Level Management) β€’ **Requirements**: - Create inventory record (warehouse_id, sku, quantity, reorder_level) - Update stock (+ or - quantity with audit logging) - Query current stock by warehouse/sku - Handle concurrent updates without losing data - Return 409 Conflict if optimistic lock fails (client retries) β€’ **Affected Files**: - src/models/Inventory.ts - src/routes/inventory.ts - src/services/InventoryService.ts - src/middleware/errorHandler.ts - tests/inventory.test.ts β€’ **Implementation Plan**: - Step 1: Define TypeScript interfaces + Zod validation schemas - Step 2: Create Knex migrations for [inventory_items, inventory_movements] tables - Step 3: Implement InventoryService with transaction handling - Step 4: Build Express routes with error boundaries - Step 5: Write unit tests for business logic - Step 6: Write integration tests (in-memory database or test DB) β€’ **Code Changes Evidence**: - 4 new database models created - 12 route handlers implemented (CRUD + bulk operations) - 250+ lines of service layer code - 95 test cases (unit + integration) β€’ **Potential Risks**: - Deadlocks under concurrent stress β†’ use statement-level timeouts - N+1 query problems β†’ use JOIN operations, not nested queries - Transaction rollback complexity β†’ use database-level constraints β€’ **Completion Status**: βœ… COMPLETED β€” All acceptance criteria met; linting clean; smoke tests pass; code compiles --- ### Phase 6 β€” Debugging Workflow (Failure: "Test: concurrent updates lose stock quantity") β€’ **Failure Captured**: - Test name: `inventory.concurrent.test.ts::should not lose stock on simultaneous updates` - Environment: Jest + test PostgreSQL container - Failure mode: Expected final quantity = 100; Actual = 95 (5 units lost) β€’ **Reproduce Issue**: - Coding Agent provides: test file, seed data, exact reproduction steps - Debugging Agent runs 50x locally β†’ reproduces 7/50 times (race condition confirmed) β€’ **Identify Likely Cause**: - Hypothesis 1: Application-level update logic has race condition (probability: HIGH) - Hypothesis 2: Database transaction isolation too loose (probability: MEDIUM) - Hypothesis 3: Test itself is flaky (probability: LOW) β€’ **Verify Root Cause**: - Debugging Agent adds database-level query logging - Finds: Two transactions both read quantity=100, both increment to 105, both write 105 (lost update problem) - Root cause: **Using application-level read-modify-write instead of atomic database UPDATE** β€’ **Implement Fix**: - Change from: `const qty = await db.select().from(inventory).where(...); await db.update().set({quantity: qty + delta})` - Change to: `await db.update(inventory).where(...).increment('quantity', delta).using('optimistic_lock')` - Use `WHERE version = expectedVersion` + fail if 0 rows updated (optimistic lock pattern) β€’ **Run Regression Tests**: - Concurrent updates test now passes 50/50 times βœ… - Existing CRUD tests still pass βœ… - New edge case test added: optimistic lock collision recovery βœ… β€’ **Review Fix**: - Review Agent confirms: Fix uses standard optimistic locking; no architectural violation; client retry logic correctly handles version conflicts β€’ **Update Documentation**: Documentation Agent adds note to API docs about 409 Conflict responses and client retry strategy --- ### Phase 7 β€” Testing Workflow (Coverage Report) β€’ **Unit Tests**: - InventoryService business logic: 40 tests (create, update, delete, reserve, release operations) - Validation schemas: 15 tests (valid/invalid inputs, edge cases) - Helper functions: 10 tests (quantity calculations, threshold checks) - **Coverage**: 98% statement coverage β€’ **Integration Tests**: - Database transactions: 20 tests (commit, rollback, concurrent scenarios) - Event publishing: 12 tests (event format validation, ordering guarantees) - Caching layer: 15 tests (cache hits, invalidation, stale data handling) - **Coverage**: 94% integration paths β€’ **API Tests**: - Route contract tests: 25 tests (all CRUD endpoints, status codes, response schemas) - Error handling: 18 tests (validation errors, 409 conflicts, 500 server errors) - Authentication/authorization: 12 tests (role-based access control) - **Coverage**: 92% endpoint coverage; 95%+ overall β€’ **Regression Tests**: - Optimistic lock fix: 8 new test cases added - Edge cases: negative quantities, overselling prevention, concurrent deletes - All 95 existing tests still pass βœ… --- ### Phase 8 β€” Code Review (Review Findings) β€’ **Finding 1** β€” CRITICAL: Missing input validation on warehouse_id - Severity: CRITICAL - Evidence: Route accepts any string; no FK constraint check until database error - Recommended Fix: Add Zod schema validation; validate warehouse_id exists before query - Status: πŸ”΄ NOT FIXED β€’ **Finding 2** β€” HIGH: No rate limiting on update endpoints - Severity: HIGH - Evidence: No rate-limit middleware; stress test shows 1000 req/sec possible from single client - Recommended Fix: Add express-rate-limit; 100 req/min per warehouse for update operations - Status: πŸ”΄ NOT FIXED β€’ **Finding 3** β€” MEDIUM: Error messages leak internal details - Severity: MEDIUM - Evidence: Database errors returned directly to client; e.g., "column 'quantity' does not exist" - Recommended Fix: Wrap all errors; return generic messages to client; log details server-side - Status: πŸ”΄ NOT FIXED β€’ **Finding 4** β€” MEDIUM: Inconsistent null handling in responses - Severity: MEDIUM - Evidence: Some endpoints return `null` for missing fields; others omit field entirely - Recommended Fix: Update OpenAPI spec + response interceptor to standardize - Status: 🟑 PARTIAL (documented but not implemented) β€’ **Finding 5** β€” LOW: Missing JSDoc comments on complex functions - Severity: LOW - Evidence: InventoryService.handleConcurrentUpdate() has no inline docs - Recommended Fix: Add JSDoc explaining optimistic lock logic + client retry behavior - Status: 🟑 PARTIAL (added basic comments; full docs pending) β€’ **Code Approval**: πŸ”΄ **BLOCKED** β€” Review Agent does not approve until Findings 1 + 2 resolved (CRITICAL + HIGH severity) --- ### Phase 9 β€” Quality Gates (Pre-Delivery Checklist) β€’ **βœ… Requirements Met**: All 5 core features implemented; API contract matches spec β€’ **πŸ”΄ Tests Passing**: 95/98 tests pass; 3 tests failing due to Finding 1 (missing warehouse validation) β€’ **πŸ”΄ Critical Bugs Resolved**: Finding 1 (CRITICAL) not fixed; blocking deployment β€’ **πŸ”΄ Code Review Completed**: Review findings exist; CRITICAL + HIGH severity blocks approval β€’ **⏳ Security Checks Completed**: Security Agent still running pen-tests; preliminary findings: OK (no authentication bypass, no SQL injection found) β€’ **⏳ Documentation Updated**: API docs 80% complete; deployment guide not started; troubleshooting guide pending β€’ **πŸ”΄ Acceptance Criteria Met**: Blocked by Findings 1 + 2; not all criteria satisfied β€’ **DELIVERY STATUS**: πŸ›‘ **BLOCKED** β€” Cannot proceed to production until: 1. Finding 1 (CRITICAL β€” input validation) resolved and tested 2. Finding 2 (HIGH β€” rate limiting) implemented and stress-tested 3. All 95 tests passing 4. Security Agent completes pen-testing 5. Code Review Agent provides approval 6. Documentation completed + reviewed --- ### Phase 10 β€” Documentation (Status) β€’ **README**: βœ… COMPLETE β€” Installation, quick start, example usage for all endpoints β€’ **API Documentation**: 🟑 PARTIAL β€” 15/18 endpoints documented in OpenAPI; missing error response codes for Finding 3 errors β€’ **Architecture Documentation**: βœ… COMPLETE β€” Database schema, event flow diagram, caching strategy, concurrency model β€’ **Setup Instructions**: βœ… COMPLETE β€” Docker Compose file, environment variables, database seeding script β€’ **Deployment Guide**: ⏳ NOT STARTED β€” Kubernetes manifests pending; waiting on security sign-off β€’ **Configuration**: 🟑 PARTIAL β€” Environment variable guide written; scaling recommendations pending performance testing β€’ **Troubleshooting**: ⏳ NOT STARTED β€” Common errors guide pending; will add after production monitoring data available β€’ **Change Log**: βœ… COMPLETE β€” Version 1.0.0 entry; lists all features, known issues, migration path for existing inventory systems --- ### Phase 11 β€” Project Status Dashboard β€’ **Task Status**: - Feature 1a (Stock Management): πŸ”΄ IN REVIEW (blocked by Finding 1) - Feature 1b (Multi-Location): βœ… COMPLETED - Feature 1c (Low-Stock Alerts): βœ… COMPLETED - Feature 2a (Order Event Sync): βœ… COMPLETED - Feature 2b (Warehouse Webhooks): 🟑 IN PROGRESS (50% done; awaiting Feature 1a unblock) - Feature 2c (Event Publishing): βœ… COMPLETED - Feature 3a (Overselling Prevention): πŸ”΄ BLOCKED (depends on Feature 1a fix) - Feature 3b (Audit Logging): βœ… COMPLETED - Feature 3c (RBAC): 🟑 IN REVIEW (code review pending) β€’ **Agent Status**: - Architect: βœ… Standby (awaiting deployment review) - Coding: πŸ”΄ BLOCKED (cannot proceed until review findings resolved) - Testing: 🟑 IN PROGRESS (running regression tests on review findings) - Debugging: βœ… Standby (no active failures) - Review: πŸ”΄ IN PROGRESS (awaiting fixes before approval) - Security: 🟑 IN PROGRESS (pen-testing 60% done) - Documentation: 🟑 IN PROGRESS (waiting on code finalization) β€’ **Blocked Tasks**: Feature 1a (input validation needed); Feature 3a (depends on 1a) β€’ **Failed Tasks**: None permanently failed; 3 tests failing due to unresolved code review findings β€’ **Review Status**: πŸ”΄ PENDING β€” 5 findings identified; 2 CRITICAL/HIGH block approval β€’ **Test Status**: 🟑 95/98 PASSING β€” 3 failures related to input validation gaps β€’ **Release Readiness**: πŸ›‘ NOT READY β€” Blocked by CRITICAL code review findings + security pen-testing completion --- ### Phase 12 β€” Failure & Escalation β€’ **Escalation Trigger #1**: Finding 1 remains unfixed after 2 hours - Reason: Coding Agent claims input validation is "unnecessary"; Review Agent insists it's critical for security - Evidence: No FK constraint at DB layer; application must validate warehouse_id exists - Recommended Human Decision: Tech lead decides: validation is mandatory per SOC 2 compliance; Coding Agent implements immediately β€’ **Escalation Trigger #2**: Security Agent pen-testing not finishing by Day 11 deadline - Reason: Complex JWT token validation edge cases discovered; may require architectural change - Evidence: Pen-test report shows potential for token replay in specific scenarios - Recommended Human Decision: Security Agent continues; if critical flaw found, escalate to architect for design review; otherwise defer to v1.1 --- ## 🧾 FINAL DELIVERY REPORT β€” TEST SUMMARY β€’ **Test Executed**: Multi-agent orchestration of E-commerce Inventory Microservice; 2-week delivery under load β€’ **Orchestration Result**: - βœ… Phases 1-8 completed successfully (requirements β†’ debugging β†’ testing β†’ review) - πŸ”΄ Phase 9 quality gates blocked delivery (CRITICAL findings not yet resolved) - Estimated resolution: +2-3 days (Finding 1 fix, retest, security sign-off) β€’ **Key Findings**: - Orchestration framework prevented shipping defective code (code review caught input validation gap) - Debugging workflow successfully identified + fixed race condition (5-unit loss in concurrent updates) - Parallel execution saved ~3 days (security/documentation ran while coding continued) - 95%+ test coverage achieved; regression test strategy prevented Finding 1 from reaching production β€’ **Handoff Quality**: All phase-to-phase handoffs included complete context; zero rework due to missing information β€’ **Agent Performance**: - Architect: Clear design docs; minimal ambiguity for downstream agents - Coding: High velocity but missed security consideration (input validation); fixed quickly - Testing: Comprehensive coverage; found race condition early - Review: Caught critical security gap; appropriately blocked approval - Security: Ongoing pen-testing; no show-stoppers yet - Documentation: Paced with development; docs accurate to actual implementation β€’ **Delivery Status**: πŸ›‘ BLOCKED FOR 2-3 DAYS β€” Resolve CRITICAL input validation finding + complete security pen-testing before production deployment --- **End of Sample Test #1**
πŸŒ€ Claude

Multi Agent Software Development

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-OPUS
Tested icon
Guide icon
4 examples icon
Free credits icon
Managing multiple AI coding agents can become chaotic when coding, debugging, testing, code review, and documentation happen without clear task ownership, dependencies, coordination, or quality gates. This prompt helps coordinate specialized AI agents across the software development lifecycle with structured task delegation, dependency management, testing, review, debugging, documentation, and delivery control. ✨ What This Prompt Helps You Do: πŸ€– Assign coding tasks to specialized agents πŸ› Coor
...more
Updated 3 weeks ago
Report
Browse Marketplace