--- name: client-value-maximizer description: > Use when the user says "maximize value", "quick wins", "audit the codebase", "client value pass", "find improvements", "low-hanging fruit", "value maximizer", "what can we improve", or wants to systematically find and implement high-impact improvements across a codebase — especially for UI design, payments, accessibility, performance, and code quality. Also triggers pre-PR validation, SOLID/OOP review, and full test + documentation pipeline. --- # Client Value Maximizer Systematic pipeline: audit across 10 dimensions in parallel → prioritize by impact/effort → brainstorm additions → implement in parallel groups by file ownership → verify with LSP + Playwright → document fully → deliver. --- ## Step 0: Brainstorm + Codebase Study (REQUIRED — before any code) ### 0A. Invoke Skills 1. Invoke `using-superpowers` — loads all applicable skills for the session. 2. Invoke `superpowers:brainstorming` with this prompt: > "Find simple additions that would add a ton of value for the client. Look for: > > - Code reusability — where is logic duplicated? What shared utilities are missing? > - SOLID and OOP violations — what has too many responsibilities? What is tightly coupled? > - Similar tests to prevent similar errors — what classes of bug keep recurring? Write regression anchors. > - Features built without hallucination — only suggest features that have clear evidence in the codebase or explicit user request. Never invent requirements. > - UI, design, payments improvements the client will feel immediately." ### 0B. Study the Entire Codebase Before writing a single line, read and understand: - Directory structure and module boundaries - Existing abstractions, base classes, shared utilities — reuse them, don't duplicate - Naming conventions, file organisation patterns, coding style - How the changed area fits into the overall data flow (draw or describe it) - What tests already exist — understand what's already covered before adding more **No implementation until you can answer:** "Where does this feature fit in the existing architecture, and what existing code does it touch or reuse?" --- ## Step 1: Discover (Parallel Audit — 10 Dimensions) Deploy one subagent per dimension. All run in parallel. Each reports findings only — no implementation. ### Dimensions | # | Dimension | Focus | | --- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | **Frontend UX** | Navigation clarity, empty states, loading skeletons, error boundaries, form UX | | 2 | **UI Design & Visual Quality** | Design system consistency, spacing, typography, color contrast, dark mode, animations, micro-interactions, component hierarchy, visual polish | | 3 | **Payments & Checkout** | Payment flow UX, trust signals, error recovery, retry logic, pricing clarity, PCI surface, webhook handling, failed-charge UX | | 4 | **Backend API** | N+1 queries, missing pagination, error shapes, auth gaps, rate limiting, input validation | | 5 | **SEO & Metadata** | Title/description, OG tags, structured data, canonical URLs, sitemap, robots.txt | | 6 | **Accessibility (a11y)** | WCAG 2.1 AA, keyboard nav, ARIA labels, focus management, color contrast, screen reader support | | 7 | **Conversion & Growth** | CTA clarity, onboarding friction, upsell opportunities, pricing page, social proof, abandonment recovery | | 8 | **Performance** | Bundle size, LCP/CLS/FID, image optimization, lazy loading, caching headers, DB query cost | | 9 | **Code Quality — SOLID/OOP** | SRP violations, tight coupling, missing abstractions, duplicated logic, missing interfaces, fragile inheritance, poor encapsulation | | 10 | **Emails & Notifications** | Transactional email copy, delivery reliability, unsubscribe flow, notification preferences | ### Agent Dispatch Prompt Template ``` You are auditing this codebase for [DIMENSION NAME] improvements. Focus on quick wins — high-impact changes that require minimal effort. For each finding output exactly: FILE: ISSUE: SEVERITY: critical | high | medium | low EFFORT: trivial (<30min) | small (1-2h) | medium (half day) | large (1+ day) FIX: SOLID_VIOLATION: (if Code Quality dimension) SRP | OCP | LSP | ISP | DIP | none --- Report findings only. Do NOT implement anything. ``` --- ## Step 2: LSP Code Intelligence Pass Before synthesis, run an **LSP diagnostic pass** across all files flagged in Step 1. Use the `LSP` tool on each flagged file to: - **Diagnostics** — surface type errors, unused imports, undefined references - **Hover** — verify types match documented intent - **Find references** — identify dead code or over-coupled modules - **Go to definition** — trace call chains for API and payment handlers This grounds the audit in compiler-verified facts rather than pattern-matching guesses. ``` For each flagged file: LSP diagnostics → add to findings if errors found LSP hover on payment/auth functions → verify types LSP find-references on shared utilities → flag if duplicated elsewhere ``` Add new findings from LSP pass to the audit pool with `SEVERITY: high` if they are type errors or undefined references. --- ## Step 3: Synthesize Merge all findings into a **Quick Wins Report**. Rules: 1. **Deduplicate** — same file + issue from multiple dimensions = one entry, tag both dimensions 2. **Prioritize** — severity (critical > high > medium > low), then effort (trivial > small > medium > large) 3. **Tag dependencies** — note if item A must precede item B 4. **Count** — totals by severity and effort tier 5. **Estimate** — sum effort ranges per priority tier Present to user. Default: implement P0 (critical) + P1 (high). --- ## Step 4: Scope (Requirements Doc) Write a requirements document for approved items. Group by **file ownership** — two agents must never touch the same file. Algorithm: 1. Collect all files touched by approved items 2. Build conflict graph (shared edges = shared files) 3. Connected components = implementation groups 4. Assign one agent per group 5. If group > 10 items, split into sequential sub-batches ### For each item include: - File path(s) - Issue description - Acceptance criteria (testable) - SOLID principle to apply (if code quality) - Reuse opportunities (flag if pattern exists elsewhere in codebase) Present requirements doc for approval before implementing. --- ## Step 5: Implement (Parallel Batches) ### A. UI / Design Additions (prioritize these for maximum client impact) For every UI component touched, the implementing agent MUST: - Apply design system tokens (colors, spacing, radius) — no magic numbers - Add hover, focus, and active states - Add loading skeletons for async content - Add empty states with actionable CTAs - Ensure dark mode compatibility - Add micro-interactions (transition durations 150–300ms) - Use semantic HTML (`