This guide walks through a complete example of using the multi-agent workflow to build a search feature from PRD to deployment.
We'll build a product search feature that allows users to:
- Search products by name
- Filter by category and price
- See paginated results
- Get search suggestions
If you're adding this feature to an existing, undocumented project, start with:
/setup
This will:
- Analyze your codebase structure
- Generate system documentation
- Create API and database references
- Infer project conventions
- Set up the documentation framework
Review the generated docs in docs/ before proceeding with the PRD.
First, create docs/product/product-search.md:
# PRD: Product Search
**Date**: 2025-01-20
**Author**: Product Team
## Overview
Add search functionality to help users find products quickly...
## User Stories
### As a customer, I want to search products by name
**Acceptance Criteria:**
- Search box on main navigation
- Real-time suggestions as I type
- Results show product name, price, image
### As a customer, I want to filter search results
**Acceptance Criteria:**
- Filter by category dropdown
- Price range slider
- Results update without page reloadRun the architect agent:
/architect docs/product/product-search.md
This creates scratch/product-search-architecture.md:
# Product Search Architecture
## Technical Approach
### Search Infrastructure
- Elasticsearch for full-text search
- Redis for caching suggestions
- PostgreSQL as source of truth
### Components
1. **Search Service** (Backend)
- Elasticsearch integration
- Query builder
- Result aggregation
2. **Search API** (Backend)
- REST endpoints
- Input validation
- Response caching
3. **Search UI** (Frontend)
- Search bar component
- Filter controls
- Results display
- Pagination
### Data Flow
1. User types in search box
2. Frontend debounces input
3. API queries Elasticsearch
4. Results cached in Redis
5. Frontend displays resultsRun the planner agent:
/planner product-search
This creates multiple task files in tasks/todo/:
---
id: backend-search-service
workstream: backend
dependencies: [database-search-indices]
estimated_hours: 16
---
# Search Service Implementation
## Subtasks
- [ ] Set up Elasticsearch client
- [ ] Create search query builder
- [ ] Implement full-text search
- [ ] Add category filtering
- [ ] Add price range filtering
- [ ] Write unit tests---
id: frontend-search-components
workstream: frontend
dependencies: []
estimated_hours: 12
---
# Search UI Components
## Subtasks
- [ ] Create SearchBar component
- [ ] Add debounced input handling
- [ ] Create FilterPanel component
- [ ] Build SearchResults component
- [ ] Add pagination controls
- [ ] Write component tests---
id: backend-search-api
workstream: backend
dependencies: [backend-search-service]
estimated_hours: 8
---
# Search API Endpoints
## Subtasks
- [ ] Create GET /api/search endpoint
- [ ] Add query parameter validation
- [ ] Implement response caching
- [ ] Add search analytics
- [ ] Write API tests---
id: database-search-indices
workstream: database
dependencies: []
estimated_hours: 4
---
# Search Database Setup
## Subtasks
- [ ] Create Elasticsearch indices
- [ ] Set up data synchronization
- [ ] Configure analyzers
- [ ] Add mapping for productsMultiple developers work simultaneously:
/developer database
- Claims
database-search-indices.md - Sets up Elasticsearch
- Moves task to done/
/developer frontend
- Claims
frontend-search-components.md - Builds UI components
- No dependencies, starts immediately
/developer backend
- Waits for database task
- Claims
backend-search-service.md - Implements search logic
As tasks complete, the folder structure evolves:
tasks/
todo/
- backend-search-service.md
- backend-search-api.md
- frontend-search-components.md
- database-search-indices.md
tasks/
todo/
- backend-search-api.md
in-progress/
- backend-search-service.md
- frontend-search-components.md
done/
- database-search-indices.md
tasks/
todo/
in-progress/
- backend-search-api.md
done/
- database-search-indices.md
- backend-search-service.md
- frontend-search-components.md
Run the testing agent:
/tester
The tester:
- Verifies search returns relevant results
- Tests filter combinations
- Validates pagination
- Checks performance (< 200ms response)
- Tests edge cases (empty results, special characters)
If issues found, tasks move back to todo/ with notes.
Run the docs agent:
/docs-agent
Updates made:
docs/tech/api-reference.md- Adds search endpoint docsdocs/system-overview.md- Updates architecture diagramdocs/CHANGELOG.md- Adds search feature entrydocs/guides/search-setup.md- Creates setup guide
Run PM agent for status:
/pm status
Output:
## Progress Report - 2025-01-22
### Overview
- Todo: 0 tasks
- In Progress: 0 tasks
- Completed Today: 4 tasks
- Feature Status: Ready for deployment
### Completed Tasks
- database-search-indices (4 hours)
- backend-search-service (15 hours)
- frontend-search-components (11 hours)
- backend-search-api (7 hours)
### Total Time: 37 hours
### Velocity: 4 tasks in 3 daysWith all tasks complete:
- Code is reviewed and merged
- Documentation is updated
- Tests are passing
- Feature is deployed
Two weeks later:
/pm archive
Tasks move to tasks/archive/2025-02/
- Parallel development saved time
- Clear dependencies prevented conflicts
- Comprehensive testing caught issues early
- Documentation stayed current
- Could break frontend into smaller tasks
- Add performance testing task
- Include monitoring setup task
- Day 1: PRD → Architecture → Tasks
- Day 2-3: Parallel development
- Day 4: Integration and testing
- Day 4: Documentation and deployment
Total: 4 days from PRD to production
- Parallel Work - Frontend started immediately while backend waited
- Clear Dependencies - No conflicts or blocking
- Incremental Progress - Each task was deployable
- Continuous Docs - Documentation never fell behind
- Quality Gates - Testing caught issues before production