Skip to content

EmeaAppGbb/appmodlab-squad-driven-feature-development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ SQUAD-DRIVEN FEATURE DEVELOPMENT ๐Ÿ•น๏ธ

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•‘   
โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–„โ–„ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–„โ–„ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•  โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   
โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ–€โ–€โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•     โ•šโ•โ•โ–€โ–€โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•   โ•šโ•โ•   
                                                                                          
      ๐Ÿ—ก๏ธ  ASSEMBLE YOUR PARTY ยท CONQUER THE QUEST ยท SHIP THE FEATURE ๐Ÿ›ก๏ธ

"A lone hero can slay goblins. But to defeat the dragon? You need a SQUAD."
โ€” Ancient DevOps Proverb


๐ŸŒŒ OVERVIEW

Welcome, brave developer, to the SQUAD-DRIVEN FEATURE DEVELOPMENT lab! In this epic quest, you'll harness the full power of your AI party to plan, implement, test, and ship a complete feature to a production-grade polyglot codebase.

Your mission: Build a Product Review & Recommendation System for ShopSmart, a bustling e-commerce platform running on TypeScript (Node.js) and Python (FastAPI). The platform already has products, users, and orders working perfectly โ€” but the reviews and recommendations modules are empty shells waiting for your SQUAD to breathe life into them.

This isn't a tutorial where you follow step-by-step instructions. This is open-world gameplay. You'll brief Brain ๐Ÿง  (the strategist), coordinate Hands ๐Ÿ‘ (the builders) across languages, summon Eyes ๐Ÿ‘๏ธ (the reviewer) to inspect quality, and deploy Mouth ๐Ÿ’ฌ (the documenter) to write the lore. Together, your party will deliver production-ready code.

๐ŸŽฏ QUEST OBJECTIVE: Ship a fully functional review + recommendation system using SQUAD.


๐ŸŽฏ WHAT YOU'LL LEARN

By completing this lab, you'll master the full SQUAD development lifecycle:

Skill SQUAD Member XP Earned
Feature decomposition & planning Brain ๐Ÿง  +300 XP
Polyglot coordination (TS + Py) Brain + Hands +500 XP
API implementation (TypeScript) Hands ๐Ÿ‘ +400 XP
ML service development (Python) Hands ๐Ÿ‘ +400 XP
Code review & quality assurance Eyes ๐Ÿ‘๏ธ +350 XP
Documentation generation Mouth ๐Ÿ’ฌ +250 XP
End-to-end integration testing Full SQUAD +500 XP
TOTAL ๐Ÿ† +2700 XP

๐ŸŒŸ Abilities Unlocked

  • Party Coordination: Direct multiple specialized agents toward a unified goal
  • Cross-Language Strategy: Manage polyglot architecture decisions
  • Iterative Development: Brief โ†’ Build โ†’ Review โ†’ Fix โ†’ Ship
  • Production Mindset: Security, performance, testing, and documentation from day one

๐ŸŽ’ INVENTORY CHECK: PREREQUISITES

Before embarking on this quest, ensure your inventory contains:

โœ… Required Items

  • โœจ Completed "Getting Started with SQUAD" lab โ€” you know how to summon your party
  • ๐Ÿ”ง Docker Desktop โ€” running and ready (for containerized services)
  • ๐Ÿ“ฆ Node.js 20+ โ€” installed and on your PATH
  • ๐Ÿ Python 3.12+ โ€” installed and ready
  • ๐Ÿค– GitHub Copilot CLI โ€” authenticated and configured
  • ๐Ÿ’ป Git โ€” for version control

โš”๏ธ Recommended Skills

  • TypeScript / Node.js experience (Express, REST APIs)
  • Python experience (FastAPI, NumPy, basic ML concepts)
  • Basic understanding of Docker Compose
  • Familiarity with PostgreSQL

๐Ÿ’ก TIP: If you haven't completed the "Getting Started with SQUAD" lab yet, do that first! You need to know how to summon Brain, Hands, Eyes, and Mouth before taking on this boss fight.


๐Ÿš€ QUICK START

๐Ÿช„ Summon the Platform

# Clone the repository (if not already done)
git clone <repository-url>
cd appmodlab-squad-driven-feature-development/shopsmart

# Start all services with Docker Compose
docker-compose up -d

# Wait ~30 seconds for services to initialize...

โœ… Verify Your Party is Ready

# Check API service (TypeScript)
curl http://localhost:3000/api/health
# Expected: {"status":"healthy","service":"shopsmart-api"}

# Check ML service (Python)
curl http://localhost:8000/health
# Expected: {"status":"healthy","service":"ml-recommender"}

# Test existing features
curl http://localhost:3000/api/products
curl http://localhost:3000/api/users
curl http://localhost:3000/api/orders

If all endpoints respond correctly: ๐ŸŽ‰ PARTY ASSEMBLED! Ready to accept quest.


๐Ÿ“ PROJECT STRUCTURE

shopsmart/
โ”œโ”€โ”€ api/                          # ๐Ÿ”ท TypeScript API (Node.js + Express)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ products.ts       # โœ… Working
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ users.ts          # โœ… Working
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ orders.ts         # โœ… Working
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ reviews.ts        # โš ๏ธ EMPTY - You'll build this!
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ recommendations.ts# โš ๏ธ EMPTY - You'll build this!
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ Dockerfile
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ ml-service/                   # ๐Ÿ Python ML Service (FastAPI)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ routes.py         # โš ๏ธ Has placeholders
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ sentiment.py      # โš ๏ธ EMPTY - You'll build this!
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ recommender.py    # โš ๏ธ EMPTY - You'll build this!
โ”‚   โ”‚   โ””โ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ Dockerfile
โ”‚   โ””โ”€โ”€ pyproject.toml
โ”‚
โ”œโ”€โ”€ database/                     # ๐Ÿ—„๏ธ PostgreSQL schemas & migrations
โ”‚   โ””โ”€โ”€ init.sql
โ”‚
โ””โ”€โ”€ docker-compose.yml            # ๐Ÿณ Orchestration config

๐ŸŽฏ YOUR TARGETS:

  • api/src/routes/reviews.ts โ€” Build from scratch
  • api/src/routes/recommendations.ts โ€” Build from scratch
  • ml-service/src/models/sentiment.py โ€” Implement sentiment analysis
  • ml-service/src/models/recommender.py โ€” Implement collaborative filtering

๐Ÿ›’ THE SHOPSMART PLATFORM

ShopSmart is a modern e-commerce platform with a microservices architecture:

๐ŸŸข What's Already Working

Feature Technology Status Description
Product Catalog TypeScript โœ… Live Browse products, search, filter
User Management TypeScript โœ… Live Registration, auth, profiles
Order System TypeScript โœ… Live Cart, checkout, order tracking
Database PostgreSQL โœ… Live Relational data with migrations
API Gateway Express โœ… Live RESTful API at localhost:3000
ML Service FastAPI โœ… Live Health endpoint only (waiting for models)

๐Ÿ”ด What's Missing (Your Quest)

The platform has skeleton code for reviews and recommendations, but they're not implemented. Customers can browse and buy products, but they can't:

  • โŒ Submit product reviews
  • โŒ See aggregated ratings
  • โŒ Get personalized recommendations
  • โŒ View "customers who liked this also liked..." suggestions

This is where your SQUAD comes in.


๐ŸŽฏ THE FEATURE SQUAD WILL BUILD

You'll implement a production-grade Product Review & Recommendation System with the following components:

๐Ÿ“ Product Review System

  • Review Submission API (TypeScript)
    • POST /api/reviews โ€” Submit a review with rating (1-5) and text
    • GET /api/reviews/:productId โ€” Fetch reviews for a product
    • GET /api/reviews/:reviewId โ€” Get a specific review
  • Review Moderation (Python)
    • Sentiment analysis to detect toxic/spam reviews
    • Auto-flag suspicious content for human review
  • Review Aggregation
    • Calculate average ratings per product
    • Count total reviews
    • Provide star distribution (5-star: 40%, 4-star: 30%, etc.)

๐ŸŽฒ Recommendation Engine

  • Collaborative Filtering (Python)
    • "Customers who liked this also liked..." algorithm
    • Matrix factorization or item-based similarity
  • Recommendation API (TypeScript)
    • GET /api/recommendations/:userId โ€” Personalized product suggestions
    • GET /api/recommendations/similar/:productId โ€” Similar products
  • Real-time Integration
    • TypeScript API calls Python ML service
    • Caching layer for performance
    • Fallback to trending products if no data

๐Ÿ›ก๏ธ Anti-Fraud Detection

  • Detect duplicate reviews from same user/IP
  • Rate limiting on review submissions
  • Velocity checks (too many reviews in short time)

๐Ÿ—๏ธ Non-Functional Requirements

  • Security: Input validation, SQL injection protection, XSS prevention
  • Performance: Response time <200ms (API), <500ms (ML)
  • Testing: Unit tests + integration tests
  • Documentation: OpenAPI/Swagger specs, README with examples

๐Ÿ•น๏ธ LAB WALKTHROUGH

๐Ÿ’Ž STEP 1: SET UP ENVIRONMENT

๐ŸŽฏ Objective: Get the platform running locally.

cd shopsmart
docker-compose up -d

Verify all services are healthy:

# API health check
curl http://localhost:3000/api/health

# ML service health check
curl http://localhost:8000/health

# Test existing endpoints
curl http://localhost:3000/api/products | jq
curl http://localhost:3000/api/users | jq
curl http://localhost:3000/api/orders | jq

โœ… Checkpoint: All services respond with 200 OK.

๐ŸŒŸ +100 XP โ€” Environment Ready!


๐Ÿง  STEP 2: BRIEF BRAIN (THE STRATEGIST)

๐ŸŽฏ Objective: Get Brain to analyze the codebase and propose an architecture.

Summon Brain with the quest briefing:

gh copilot squad -a Brain

Example Briefing:

"Brain, I need you to analyze the ShopSmart platform and design a Product Review & Recommendation System. The platform is polyglot: TypeScript API (Express) and Python ML service (FastAPI).

Requirements:

  • Review submission API (POST /api/reviews)
  • Review retrieval (GET /api/reviews/:productId)
  • Sentiment analysis for moderation (Python)
  • Collaborative filtering for recommendations (Python)
  • API endpoints for recommendations (TypeScript)
  • Anti-fraud detection (duplicate reviews, rate limiting)
  • OpenAPI documentation

Explore the codebase in api/ and ml-service/ to understand the existing patterns. Then propose:

  1. Database schema changes (if needed)
  2. API endpoints specification
  3. ML model approach
  4. Integration strategy between TypeScript and Python
  5. Testing strategy

Give me a detailed implementation plan."

๐Ÿ“œ QUEST ACCEPTED! Brain will explore the code and return a battle plan.

๐ŸŒŸ +200 XP โ€” Strategy Formulated!


โš”๏ธ STEP 3: ARCHITECTURE DECISION

๐ŸŽฏ Objective: Review Brain's proposal and approve the approach.

Brain will present a plan that might look like:

Database Schema:

CREATE TABLE reviews (
  id UUID PRIMARY KEY,
  product_id UUID REFERENCES products(id),
  user_id UUID REFERENCES users(id),
  rating INTEGER CHECK (rating BETWEEN 1 AND 5),
  review_text TEXT,
  sentiment_score FLOAT,
  is_flagged BOOLEAN DEFAULT FALSE,
  created_at TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_reviews_product ON reviews(product_id);
CREATE INDEX idx_reviews_user ON reviews(user_id);

API Endpoints:

  • POST /api/reviews
  • GET /api/reviews/:productId
  • GET /api/reviews/:reviewId
  • GET /api/recommendations/:userId
  • GET /api/recommendations/similar/:productId

ML Services:

  • Sentiment analysis using transformers (Hugging Face)
  • Item-based collaborative filtering using cosine similarity

Your job: Review, ask follow-up questions, approve or request changes.

๐ŸŒŸ +100 XP โ€” Architecture Approved!


๐Ÿ‘ STEP 4: IMPLEMENT REVIEW API (TYPESCRIPT)

๐ŸŽฏ Objective: Have Hands build the TypeScript review endpoints.

Summon Hands:

gh copilot squad -a Hands

Example Directive:

"Hands, implement the Review API in TypeScript following the architecture Brain designed.

Tasks:

  1. Create database migration in database/migrations/ for reviews table
  2. Implement api/src/routes/reviews.ts with:
    • POST /api/reviews (validation, auth required)
    • GET /api/reviews/:productId (with pagination)
    • GET /api/reviews/:reviewId
  3. Create model in api/src/models/review.ts
  4. Add input validation middleware
  5. Implement anti-fraud checks (duplicate detection, rate limiting)
  6. Add unit tests in api/tests/reviews.test.ts

Follow the existing code style in products.ts and users.ts. Use the same error handling patterns."

โณ Hands will code the implementation...

๐ŸŒŸ +400 XP โ€” TypeScript Module Complete!


๐Ÿ STEP 5: IMPLEMENT ML SERVICE (PYTHON)

๐ŸŽฏ Objective: Have Hands build the Python sentiment analysis and recommendation engine.

Brief Hands again (or continue the conversation):

"Hands, now implement the ML service components in Python.

Tasks:

  1. Implement ml-service/src/models/sentiment.py:
    • Use transformers library for sentiment analysis
    • Return sentiment score (-1 to 1)
    • Flag toxic content
  2. Implement ml-service/src/models/recommender.py:
    • Collaborative filtering using item-based similarity
    • Cosine similarity on user-product interaction matrix
    • Return top 10 recommendations
  3. Update ml-service/src/api/routes.py:
    • POST /analyze-sentiment
    • POST /recommend/:userId
    • POST /similar/:productId
  4. Add tests in ml-service/tests/
  5. Update pyproject.toml with dependencies (transformers, scikit-learn, numpy)

Make sure it integrates with the TypeScript API via HTTP calls."

โณ Hands will build the Python components...

๐ŸŒŸ +400 XP โ€” Python Module Complete!


๐Ÿ‘๏ธ STEP 6: CODE REVIEW (EYES)

๐ŸŽฏ Objective: Have Eyes review all implementations for quality, security, and bugs.

Summon Eyes:

gh copilot squad -a Eyes

Example Directive:

"Eyes, perform a comprehensive code review of the new review and recommendation features.

Review:

  • api/src/routes/reviews.ts
  • api/src/routes/recommendations.ts
  • api/src/models/review.ts
  • ml-service/src/models/sentiment.py
  • ml-service/src/models/recommender.py
  • ml-service/src/api/routes.py

Focus on:

  • Security vulnerabilities (SQL injection, XSS, auth bypass)
  • Performance issues (N+1 queries, missing indexes)
  • Error handling (edge cases, null checks)
  • Code quality (TypeScript/Python best practices)
  • Test coverage gaps

Provide specific line numbers and actionable feedback."

๐Ÿ” Eyes will analyze the code...

Eyes might report issues like:

  • โŒ Missing input sanitization on review_text
  • โŒ No rate limiting on POST /api/reviews
  • โŒ Sentiment model not cached (loads on every request)
  • โŒ Missing error handling for ML service downtime

๐ŸŒŸ +350 XP โ€” Code Reviewed!


๐Ÿ› ๏ธ STEP 7: FIX REVIEW FEEDBACK

๐ŸŽฏ Objective: Have Hands address all issues Eyes found.

Brief Hands:

"Hands, Eyes found several issues in the code review. Fix them all:

Issues to Fix:

  1. [Copy specific issues from Eyes' report]
  2. Add input sanitization for review_text
  3. Implement rate limiting middleware
  4. Cache sentiment model in memory
  5. Add circuit breaker for ML service calls
  6. Improve error messages

Run the tests after each fix to ensure nothing breaks."

โณ Hands will fix the issues...

Re-run Eyes if needed:

gh copilot squad -a Eyes
# "Eyes, re-review the files that were changed. Confirm all issues are resolved."

๐ŸŒŸ +300 XP โ€” All Bugs Squashed!


๐Ÿ’ฌ STEP 8: DOCUMENTATION (MOUTH)

๐ŸŽฏ Objective: Have Mouth generate comprehensive API documentation.

Summon Mouth:

gh copilot squad -a Mouth

Example Directive:

"Mouth, generate complete documentation for the new review and recommendation features.

Tasks:

  1. Create OpenAPI/Swagger spec for:
    • POST /api/reviews
    • GET /api/reviews/:productId
    • GET /api/reviews/:reviewId
    • GET /api/recommendations/:userId
    • GET /api/recommendations/similar/:productId
  2. Write api/docs/REVIEWS_API.md with:
    • Endpoint descriptions
    • Request/response examples
    • Error codes
    • Authentication requirements
  3. Write ml-service/docs/ML_SERVICES.md with:
    • Model descriptions
    • API contracts
    • Performance characteristics
  4. Update main README.md with feature overview

Make it clear and easy for developers to integrate with these APIs."

๐Ÿ“ Mouth will write the docs...

๐ŸŒŸ +250 XP โ€” Documentation Complete!


๐Ÿงช STEP 9: INTEGRATION TESTING

๐ŸŽฏ Objective: Test the entire flow end-to-end.

Manual Testing:

# 1. Submit a review
curl -X POST http://localhost:3000/api/reviews \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "product_id": "550e8400-e29b-41d4-a716-446655440000",
    "rating": 5,
    "review_text": "Amazing product! Highly recommend."
  }'

# 2. Get reviews for a product
curl http://localhost:3000/api/reviews/550e8400-e29b-41d4-a716-446655440000 | jq

# 3. Get recommendations for a user
curl http://localhost:3000/api/recommendations/123e4567-e89b-12d3-a456-426614174000 | jq

# 4. Get similar products
curl http://localhost:3000/api/recommendations/similar/550e8400-e29b-41d4-a716-446655440000 | jq

Automated Testing:

# Run API tests
cd api
npm test

# Run ML service tests
cd ../ml-service
python -m pytest

# Check test coverage
npm run test:coverage
pytest --cov

โœ… Success Criteria:

  • All tests pass โœ…
  • Review submission works โœ…
  • Sentiment analysis flags toxic content โœ…
  • Recommendations return relevant products โœ…
  • Response times meet SLA (<200ms API, <500ms ML) โœ…

๐ŸŒŸ +500 XP โ€” Integration Testing Complete!


๐Ÿšข STEP 10: SHIP IT

๐ŸŽฏ Objective: Merge and deploy the feature.

# Ensure all tests pass
npm test
pytest

# Check linting
npm run lint
flake8 ml-service/src

# Commit your changes
git add .
git commit -m "feat: Add product review and recommendation system

- Implement review submission and retrieval API (TypeScript)
- Add sentiment analysis for review moderation (Python)
- Build collaborative filtering recommendation engine (Python)
- Add anti-fraud detection (rate limiting, duplicate checks)
- Generate OpenAPI documentation
- Add comprehensive test coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"

# Push to remote
git push origin feature/reviews-recommendations

# Create PR and deploy! ๐Ÿš€

๐Ÿ‰ BOSS DEFEATED! Feature Shipped to Production! ๐ŸŽ‰

๐ŸŒŸ +1000 XP โ€” QUEST COMPLETE!


โฑ๏ธ ESTIMATED DURATION

Phase Time Difficulty
Environment Setup 15 min โญ Easy
Brief Brain & Planning 30 min โญโญ Medium
Implement TypeScript API 60 min โญโญโญ Hard
Implement Python ML 60 min โญโญโญ Hard
Code Review with Eyes 30 min โญโญ Medium
Fix Issues 30 min โญโญ Medium
Documentation 20 min โญ Easy
Integration Testing 30 min โญโญ Medium
TOTAL 3-4 hrs โญโญโญโญ Epic

๐Ÿ’ก TIP: This is not a race! Take breaks between phases. The SQUAD doesn't get tired, but you do.


๐ŸŽ“ LEARNING OUTCOMES

After completing this lab, you'll be able to:

โœ… Decompose complex features into implementable tasks using Brain
โœ… Coordinate polyglot development across TypeScript and Python
โœ… Build production-grade APIs with proper validation, auth, and error handling
โœ… Implement ML features with practical algorithms (sentiment analysis, collaborative filtering)
โœ… Conduct thorough code reviews using Eyes to catch security and quality issues
โœ… Generate comprehensive documentation with Mouth
โœ… Test end-to-end flows in microservices architectures
โœ… Ship features confidently with SQUAD-verified quality


๐Ÿ† ACHIEVEMENTS UNLOCKED

  • ๐Ÿ—ก๏ธ First Blood โ€” Completed environment setup
  • ๐Ÿง  Master Strategist โ€” Used Brain to plan a complex feature
  • ๐Ÿ‘ Polyglot Warrior โ€” Built features in TypeScript AND Python
  • ๐Ÿ‘๏ธ Eagle Eye โ€” Used Eyes to prevent bugs from reaching production
  • ๐Ÿ’ฌ Lorekeeper โ€” Generated complete documentation with Mouth
  • ๐ŸŽฏ Full SQUAD Deploy โ€” Used all four SQUAD members in one quest
  • ๐Ÿ‰ Dragon Slayer โ€” Shipped a production-ready feature end-to-end
  • ๐ŸŒŸ Level Up! โ€” Gained 2700+ XP in SQUAD mastery

๐Ÿ†˜ TROUBLESHOOTING

๐Ÿ”ฅ Services Won't Start

# Check Docker status
docker ps

# View logs
docker-compose logs api
docker-compose logs ml-service

# Restart services
docker-compose down
docker-compose up -d

๐Ÿ”ฅ TypeScript API Errors

cd api
npm install  # Reinstall dependencies
npm run build  # Rebuild TypeScript
docker-compose restart api

๐Ÿ”ฅ Python ML Service Errors

cd ml-service
pip install -e .  # Reinstall dependencies
docker-compose restart ml-service

๐Ÿ”ฅ Database Connection Issues

# Check PostgreSQL logs
docker-compose logs db

# Reset database (โš ๏ธ deletes data!)
docker-compose down -v
docker-compose up -d

๐ŸŽฎ NEXT STEPS

๐ŸŒŸ Extend the Quest

Want to level up even more? Try these bonus challenges:

  • ๐Ÿ”ฅ Hard Mode: Add real-time review notifications using WebSockets
  • ๐Ÿง™ Wizard Mode: Implement image upload for reviews (with ML-based moderation)
  • ๐Ÿฐ Raid Boss: Deploy to Kubernetes with auto-scaling
  • ๐ŸŽจ Cosmetic Upgrade: Build a React frontend to display reviews
  • ๐Ÿ“Š Analytics Dashboard: Add review sentiment trends over time

๐Ÿ“š More Labs

  • โœ… Getting Started with SQUAD โ€” Learn the basics (prerequisite)
  • ๐Ÿš€ SQUAD-Driven Debugging โ€” Fix bugs with your party
  • ๐Ÿ” SQUAD Security Hardening โ€” Use Eyes to find vulnerabilities
  • ๐Ÿ“– SQUAD Documentation Overhaul โ€” Revamp docs with Mouth

๐Ÿ“œ LICENSE

This lab is part of the App Modernization Labs series.
ยฉ Microsoft Corporation. All rights reserved.


๐Ÿ™ ACKNOWLEDGMENTS

Quest Design: Marco Antonio Silva
Lore & Documentation: Dana (Technical Writer)
AI Party Members: Brain ๐Ÿง , Hands ๐Ÿ‘, Eyes ๐Ÿ‘๏ธ, Mouth ๐Ÿ’ฌ
Platform: GitHub Copilot + SQUAD


โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                                                            โ•‘
โ•‘   ๐ŸŽ‰ CONGRATULATIONS, HERO!                                 โ•‘
โ•‘                                                            โ•‘
โ•‘   You've mastered SQUAD-driven feature development.       โ•‘
โ•‘   Your party is ready for any quest the codebase          โ•‘
โ•‘   throws at you.                                          โ•‘
โ•‘                                                            โ•‘
โ•‘   ๐Ÿ—ก๏ธ  May your builds be green and your deploys smooth.    โ•‘
โ•‘                                                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐ŸŽฎ GAME OVER โ€” PRESS START TO SHIP MORE FEATURES ๐Ÿ•น๏ธ


๐Ÿ“œ SOLUTION WALKTHROUGH

The complete solution is on the solution-final branch with tagged commits for each step.

git checkout solution-final

Step 1: Explore Application (step-01-explore-app)

gh copilot -- -p "Analyze the ShopSmart e-commerce application codebase. Identify the tech stack, architecture, existing features, and areas for improvement." --allow-all-tools --yolo

Result: Identified TypeScript/Fastify API + Python/FastAPI ML service, PostgreSQL + Redis, Docker Compose. Reviews module is empty stub (shopsmart/api/src/modules/reviews/.gitkeep).

Step 2: Initialize Squad (step-02-initialize-squad)

npx @bradygaster/squad-cli init

Result: Assembled SQUAD โ€” Brain ๐Ÿง  (strategist), Hands ๐Ÿ‘ (builder), Eyes ๐Ÿ‘๏ธ (reviewer), Mouth ๐Ÿ’ฌ (documenter).

Step 3: Feature Planning (step-03-feature-planning)

gh copilot -- -p "As the Squad Lead, create a feature development plan for adding a product review and rating system to ShopSmart. Break it down into tasks for each agent." --allow-all-tools --yolo

Result: Brain created 5-phase plan with 17 tasks: Backend API โ†’ ML Recommendations โ†’ Testing โ†’ Code Review โ†’ Documentation.

Step 4: Backend Implementation (step-04-backend-impl)

gh copilot -- -p "As the Squad Backend developer, implement the product review API endpoints: POST /api/reviews, GET /api/products/:id/reviews, PUT /api/reviews/:id, DELETE /api/reviews/:id. Include data models, validation, and database integration." --allow-all-tools --yolo

Result: Created 4 files mirroring the Product module pattern:

  • review.types.ts โ€” Review, CreateReviewInput, UpdateReviewInput, ProductRating
  • review.schema.ts โ€” Fastify JSON Schema validation
  • review.service.ts โ€” CRUD + rating aggregation with parameterized queries
  • review.routes.ts โ€” 6 REST endpoints
  • Updated server.ts to register review routes

Step 5: ML Service Implementation (step-05-frontend-impl)

gh copilot -- -p "As the Squad ML developer, implement the recommendation engine with collaborative filtering and similar products." --allow-all-tools --yolo

Result: Built recommendation engine:

  • recommendation.py โ€” Pydantic models
  • engine.py โ€” Collaborative filtering + popular products fallback
  • router.py โ€” FastAPI endpoints for user recommendations and similar products
  • Updated main.py with router and lifecycle events

Step 6: Test Suite (step-06-test-suite)

gh copilot -- -p "As the Squad Tester, write comprehensive tests for the review system and recommendation engine." --allow-all-tools --yolo
npx vitest run  # 18 tests passed โœ…

Result: 16 TypeScript tests (ReviewService CRUD) + 11 Python tests (models, engine, endpoints). All passing.

Step 7: Code Review (step-07-code-review)

gh copilot -- -p "As the Squad Reviewer, perform a multi-agent code review covering security, performance, and code quality." --allow-all-tools --yolo

Result: APPROVED โœ… โ€” Parameterized queries (no SQL injection), proper indexing, consistent patterns, good error handling.

Step 8: Documentation (step-08-documentation)

gh copilot -- -p "As the Squad Documenter, generate complete API documentation for the review and recommendation system." --allow-all-tools --yolo

Result: Created docs/REVIEW-API.md โ€” Full API reference with request/response examples for all 8 endpoints.

Step 9: Retrospective (step-09-retrospective)

gh copilot -- -p "Run a sprint retrospective for the SQUAD feature development." --allow-all-tools --yolo

Result: 17/17 tasks completed. Action items: add JWT auth, Redis caching, integration tests, rate limiting.

Output Files

All CLI outputs are captured in assets/outputs/:

File Description
step-01-explore-app.txt Codebase analysis
step-02-initialize-squad.txt Squad initialization
step-03-feature-planning.txt Feature plan with 17 tasks
step-04-backend-impl.txt Backend implementation log
step-05-frontend-impl.txt ML service implementation log
step-06-test-suite.txt Test results (18 passed)
step-07-code-review.txt Security + performance review
step-08-documentation.txt Documentation generation
step-09-retrospective.txt Sprint retrospective

About

๐Ÿ•น๏ธ AppMod Lab: SQUAD-driven feature development on polyglot codebase โ€” ShopSmart e-commerce

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors