AutoPilot: 5 AI agents that autonomously run your Shopify store#2
Open
joshgaskin wants to merge 29 commits intoGrowzilla:mainfrom
Open
AutoPilot: 5 AI agents that autonomously run your Shopify store#2joshgaskin wants to merge 29 commits intoGrowzilla:mainfrom
joshgaskin wants to merge 29 commits intoGrowzilla:mainfrom
Conversation
… widget - 4-agent orchestration system (Rick/Hank/Ron/Marcus) with intelligence layer - AutoPilot page: 4-tab command center (Agents/Inventory/Actions/Live) - Segments page: RFM customer segmentation with donut chart - Low-stock urgency widget for storefront injection - Shell nav updated with AutoPilot + Segments entries Refs #1
- Server-side agent orchestrator runs every 60s independently of browser - Rick (ops), Hank (supply chain), Ron (finance), Marcus (coordinator) - Intelligence layer: product scoring, stockout detection, slow movers - Claude API integration for agent voice/personality narration - Agent actions persisted to SQLite, exposed via /agents/* API - Frontend polls backend for agent state (pure read-only dashboard) - Sample data seed when Shopify sync unavailable Refs #1
Realistic scenarios: hot sellers with stockout risk, slow movers for discounting, health issues (missing images, $0 price, active+OOS), draft products with stock. Weighted velocity patterns to trigger all agent behaviors. Refs #1
- Rick: deactivates zero-stock products, tags low-stock items - Hank: tags products with tier labels, creates draft POs for reorders - Ron: creates price rules + discount codes for slow movers - Marcus: deploys storefront urgency widget via ScriptTag - Graceful fallback: logs [DEMO] Would... when Shopify unavailable Refs #1
- Marty: customer segmentation, win-back campaigns, VIP early-access, product tagging for content-before-discount strategy - Agent cards now show profile pictures (avatars in /public/agents/) - 5-agent grid layout, pulsing status indicator for active agents - New action types: segment_analyzed, product_tagged, email campaigns Refs #1
Replace flat ActionLog with AgentDialogue component: - Chat bubble layout with agent avatars and colored left borders - Marcus messages highlighted in accent green - Fade-in animation on new messages - Hover-to-show timestamps - Type badges (Stockout, Discount, Campaign, etc.) Refs #1
- Click an agent card to filter dialogue to just their actions - Click again to show all agents - Selected card gets accent border + ring - Added profile images for Marcus, Hank, Marty, Ron - Fixed avatar file extensions to match actual files Refs #1
Every metric explains itself on hover: - Tabs: what each section shows - KPI cards: what the number means and which agent owns it - Table columns: how scores/tiers/velocity/days-left are calculated - References which agent acts on each metric Refs #1
…racking - purchase_orders + po_line_items SQLite tables - Hank creates consolidated draft POs when products need restocking - Inbound stock from active POs factored into days-left calculation - Won't double-order: if inbound covers 7+ days, skips reorder - GET /purchase-orders — list POs with line items - GET /purchase-orders/inbound — inbound stock by product - PATCH /purchase-orders/:id — update PO status Refs #1
_has_acted keys are now restored from existing DB actions on startup. Cycle counter also restored. Restart = 0 new actions (unless data changed). Refs #1
- Hover any action to see "Revert" button (discounts, tags, POs, alerts) - Reverted actions show strikethrough + red badge + greyed out - Clears dedup key so agent can re-evaluate on next cycle - POST /agents/actions/:id/revert endpoint Refs #1
- /purchase-orders page with PO table, line item detail, inbound stock - Click a PO row to expand line items - "Advance status" button (draft → ordered → shipped → received) - Inbound stock table showing what's on the way per product - KPIs: active POs, drafts, in transit, total inbound units - Added to sidebar nav Refs #1
- Rick deactivates zero-stock products in local DB (status → draft) - Ron saves discount codes to local discounts table - GET /agents/discounts endpoint to view created codes - Removed [DEMO] prefix — actions are real, just local instead of Shopify - POs already working (Hank) Refs #1
Product matching was falling through to variant title comparison (S/M/L) which matched the first product for EVERY order. Now matches by product title only. Also increased seed order volume and sharpened declining product pattern so Ron/Hank actually trigger. Results: 4 stockout alerts, 5 slow movers, 1 discount code, 1 PO with 214 units across 4 products. Refs #1
Added CRITICAL DATA HONESTY RULES to every persona: - Only reference numbers from actual data (stock, velocity, price, segments) - Never invent CTR, conversion rates, margins, lead times, or analytics - Shorter responses (1-2 sentences) - "We'd need to check" instead of fabricating Refs #1
…ients Win-back and VIP campaigns now include Claude-generated email copy, subject lines, recipient lists from customer DB, and discount codes. Visible in the agent dialogue as full email previews. Refs #1
- Removed 566 lines of dead client-side agent code (frontend/lib/agents/) Real agents are in backend/app/agents/ - Renamed email_sent → email_drafted (emails are drafted, not sent) - Removed unused api import from autopilot.tsx - Updated KPI labels to match reality Refs #1
…does - Orchestrator docstring clarifies local DB vs Shopify behavior - CLAUDE.md now has full AutoPilot description with agent table, architecture, and key file references - Ron's docstring updated to reflect local DB + Shopify dual mode - Ready for code review Refs #1
Homepage now sells AutoPilot: - Hero with tagline + CTA to command center - Store KPIs from live data - Meet the Team — 5 agent cards with avatars and descriptions - 3 pricing tiers: Starter ($49), Growth ($149), Enterprise (custom) Refs #1
Restored dashboard to original. Added /pricing page with: - Hero + CTA to command center - Meet the Team — 5 agent cards with avatars - 3 pricing tiers: Starter ($49), Growth ($149), Enterprise - Added to sidebar nav Refs #1
Pre-generated fixture files load on first startup: - 32 agent actions with personality-rich commentary - 5 agent states (all active) - 1 purchase order (214 units, $8,963) - 3 discount codes for slow movers Anyone who clones and runs gets the full demo instantly. Refs #1
…tary - POST /agents/reset clears all actions, states, POs, discounts - Resets dedup keys so agents re-evaluate everything - Triggers immediate fresh cycle with new Claude narration - Button next to tabs on autopilot page - For live demos: click to watch agents think and act in real-time Refs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents
Test plan
npm run dev— frontend on :3000, backend on :8000Closes #1