# Shared Patterns & Deliverables ## Core Workflows ```yaml Dev: Full Stack: load→analyze→design→build→test→scan→deploy Feature: analyze→build→test→improve→commit Bug Fix: troubleshoot→fix→test→verify→commit Quality: Code Review: analyze→improve→scan→test Perf: analyze→improve→test→measure Security: scan→improve→validate→test Maintenance: Cleanup: cleanup→analyze→improve→test Update: migrate→test→validate→deploy Refactor: analyze→design→improve→test ``` ## Universal Flags ```yaml Planning: --plan (show execution plan first) Thinking: --think (4K) | --think-hard (10K) | --ultrathink (32K) Docs: --uc (ultracompressed 70% reduction) MCP: --c7 --seq --magic --pup | --all-mcp | --no-mcp Execution: --dry-run | --watch | --interactive Quality: --tdd | --iterate | --threshold N% ``` ## Error Types ```yaml Syntax: Typos|brackets|quotes → Check syntax Runtime: Null|undefined|types → Validate inputs Logic: Conditions|loops|state → Trace flow Performance: N+1|memory|blocking → Profile Integration: API|auth|format → Check contracts ``` ## MCP Usage ```yaml Sequential: Complex analysis|Architecture|Debug Context7: Docs|Examples|Patterns Magic: UI components|Prototypes Puppeteer: E2E|Visual|Performance ``` ## Research Patterns ```yaml Library Usage: Detect import→C7 lookup→Cache pattern→Implement with citation Component Creation: Identify need→Search existing→Magic builder→Document source API Integration: Find docs→Check auth→Review limits→Implement→Note constraints Unknown Pattern: Sequential thinking→WebSearch→Multiple sources→Choose best Research Cache: Session-based: Keep patterns until session end Cite previous: "Using researched pattern from earlier" Invalidate: On version change or conflicting info ``` ## Deliverables ### Code ```yaml Commits: type: description | feat|fix|refactor|perf|test|docs | Why>What Docs: API(endpoints|params|examples) | Code(JSDoc|README) | User(guides|FAQs) Tests: Unit(functions|logic) | Integration(APIs|services) | E2E(flows|paths) ``` ### Reports ```yaml Performance: Baseline→Current→Improvement% | Time|memory|CPU|network Security: Vulnerabilities→Risk→Fixes | OWASP|deps|auth|data Quality: Coverage|complexity|duplication → Issues→Severity→Resolution ``` ### Artifacts ```yaml Configs: .env|settings|deployment | Scripts: build|test|deploy|migrate Schemas: Database|API|validation | Assets: Images|styles|components ``` ## Accelerated Workflows ```yaml Fast Chains: Fix Known: /user:improve --quality [uses prior analyze] Quick Deploy: /user:deploy [uses prior test+scan] Smart Build: /user:build [skips unchanged modules] Auto Skip: Unchanged files → Skip re-analysis Passed tests → Skip re-test Clean scan → Skip re-scan ``` ## Clean Workflows ```yaml Pre-Operations: cleanup→build→test→deploy Maintenance: analyze→cleanup→improve→test Development: cleanup→code→commit→push Release: cleanup→build→test→scan→deploy Clean-First Patterns: Build: Remove old artifacts → Clean cache → Fresh build Deploy: Clean previous version → Validate config → Deploy new Test: Clean test outputs → Reset state → Run tests Develop: Clean workspace → Remove debug code → Commit clean ``` ## Command Integration Patterns ```yaml Sequential Chains: Full Development: load → analyze → design → build → test → deploy Bug Investigation: troubleshoot --investigate → troubleshoot --fix → test Quality Pipeline: analyze → improve --quality → scan --validate → test Parallel Operations: Multi-Stack: build --react & build --api & test --e2e Quality Gates: scan --security & test --coverage & analyze --performance Conditional Flows: Safe Deploy: scan --validate && test --e2e && deploy --env prod Rollback: deploy --rollback || troubleshoot --investigate Context Sharing: Analysis → Implementation: analyze → build (uses analysis context) Design → Development: design → build (uses design patterns) Investigation → Fix: troubleshoot --investigate → improve (uses findings) ``` ## UltraCompressed Patterns ```yaml Activation Patterns: Manual: --uc flag | "ultracompressed" keyword Auto: Context >70% | Token budget specified Smart: Large docs → Suggest compression Documentation Patterns: Start: Legend table | Only used symbols/abbrevs Structure: Lists>prose | Tables>paragraphs | YAML>text Content: Direct info | No fluff | Telegram-style Example Transformations: Normal: "Configure the authentication system by setting environment variables" Compressed: "Auth cfg: set env vars" Normal: "This function processes user input and returns validation result" Compressed: "fn: process usr input→validation" Token Savings: Headers: 60-80% reduction Paragraphs: 70-75% reduction Lists: 50-60% reduction Overall: ~70% average reduction ```