### Agent Chaining Example: API Documentation Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Shows how to use agents to generate comprehensive API documentation and integration guides for a REST API. ```markdown User: "We need to document our REST API" 1. @agents/api-documenter.md - "Create comprehensive API docs" 2. @agents/documentation-technical.md - "Write integration guides" ``` -------------------------------- ### SvelteKit Developer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the SvelteKit Developer agent, focusing on SvelteKit applications, Svelte components, and SSR/SSG. ```markdown ``` "Create a SvelteKit app with authentication" "Build reactive Svelte components" "Implement server-side rendering" ``` ``` -------------------------------- ### Feature Development Chain Example Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md An example of chaining multiple agents for developing a new feature, covering architecture, API design, UI mockups, backend and frontend implementation, testing, and documentation. ```markdown 1. @agents/architecture-solutions.md - Design the feature architecture 2. @agents/api-designer.md - Design the API 3. @agents/ux-designer.md - Create UI mockups 4. @agents/api-implementer.md - Build the backend 5. @agents/flutter-developer.md - Build mobile UI 6. @agents/test-architect.md - Create test plan 7. @agents/test-implementer.md - Write tests 8. @agents/documentation-technical.md - Document the feature ``` -------------------------------- ### Example Test Matrix Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/consolidation/IMPLEMENTATION_RECOMMENDATIONS.md Provides an example of a test matrix for evaluating consolidated agents, outlining test scenarios and success criteria for each agent. ```markdown | Consolidated Agent | Test Scenarios | Success Criteria | |-------------------|----------------|------------------| | architect | System design, Innovation, Risk analysis | Maintains depth of both brainstormer and solutions-architect | | frontend-developer | React app, Flutter app, Svelte app, UX design | Handles all frameworks with appropriate expertise | | data-engineer | PostgreSQL optimization, RDF queries, ETL design | Covers relational, semantic, and pipeline design | ``` -------------------------------- ### Architecture Solutions Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Architecture Solutions agent, covering system design, pattern selection, and architectural documentation. ```markdown ``` "Design a microservices architecture for an e-commerce platform" "Create C4 diagrams for our system" "Write an ADR for choosing between REST and GraphQL" ``` ``` -------------------------------- ### Response Examples: Weak vs. Acceptable Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Provides examples of weak and acceptable responses in project coordination, highlighting the difference between casual suggestions and concrete actions. ```text Weak Response (NEVER) "You should consider writing some documentation for this feature." Acceptable Response (MINIMUM) "I've created basic documentation for the new functionality." ``` -------------------------------- ### Ash Framework Examples: Creating and Updating Posts with Tags Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Demonstrates practical examples of creating a post with new tags and updating a post to replace its existing tags using IDs in the Ash Framework. ```elixir # Creating a post with tags MyDomain.create_post!(%{ title: "New Post", body: "Content here...", tags: [%{name: "elixir"}, %{name: "ash"}] # Creates new tags }) # Updating a post to replace its tags MyDomain.update_post!(post, %{ tags: [tag1.id, tag2.id] # Replaces tags with existing ones by ID }) ``` -------------------------------- ### Mix Task Help and Usage Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/usage_rules_elixir.md Provides examples of how to use `mix help` to discover available tasks and get detailed documentation for specific mix tasks. ```bash mix help mix help test mix help compile ``` -------------------------------- ### Install PROACTIVE Agent System Source: https://github.com/mudspot/prometheus-agents/blob/main/README.md Provides instructions for deploying the PROACTIVE agent system either at the project level or user level for global access. The project-level installation is recommended. ```bash mkdir -p .claude/agents cp agents/*.md .claude/agents/ ``` ```bash mkdir -p ~/.claude/agents cp agents/*.md ~/.claude/agents/ ``` -------------------------------- ### Agent Selection Guide for New Projects Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_SUMMARY.md This guide outlines the recommended sequence of agents for initiating a new software development project, from ideation to planning. ```APIDOC Agent Selection Guide: For Starting a New Project: 1. Use brainstormer for ideation. 2. Use architecture-solutions for system design. 3. Use specifications-writer to document requirements. 4. Use project-coordinator for planning. ``` -------------------------------- ### API Endpoints for MFA Setup and Verification Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Defines the OpenAPI specification for MFA endpoints, including initializing TOTP setup (generating QR codes and backup codes) and verifying TOTP tokens. ```APIDOC # MFA Setup Endpoints /api/v2/mfa/totp/setup: post: summary: Initialize TOTP setup description: Generate QR code and backup codes for TOTP setup responses: 200: content: application/json: schema: type: object properties: qr_code_url: type: string description: Data URL for QR code image manual_entry_key: type: string description: Manual entry key for authenticator apps backup_codes: type: array items: type: string description: One-time recovery codes /api/v2/mfa/totp/verify: post: summary: Verify and enable TOTP requestBody: required: true content: application/json: schema: type: object required: [token] properties: token: type: string pattern: "^[0-9]{6}$" responses: 200: description: TOTP verified and enabled 400: description: Invalid token ``` -------------------------------- ### Data Architecture Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Data Architecture agent, covering database design, data modeling, and ETL pipeline creation. ```markdown ``` "Design a data warehouse schema" "Create an ETL pipeline architecture" "Model relationships using Ash resources" ``` ``` -------------------------------- ### Agent Chaining Example: Building a New Feature Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Illustrates how to chain multiple agents to add user profiles to an application, covering architecture design, data modeling, API specification, UI design, API implementation, and front-end development. ```markdown User: "I need to add user profiles to our app" 1. @agents/architecture-solutions.md - "Design the architecture for user profiles" 2. @agents/data-architecture.md - "Design the data model for profiles" 3. @agents/api-designer.md - "Create OpenAPI spec for profile endpoints" 4. @agents/ux-designer.md - "Design the profile UI" 5. @agents/api-implementer.md - "Implement profile API with Ash" 6. @agents/flutter-developer.md - "Build profile screens with GetX" ``` -------------------------------- ### Web Developer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Web Developer agent, covering HTML, JavaScript, TailwindCSS, and Phoenix LiveView UI development. ```markdown ``` "Create responsive components with TailwindCSS" "Implement client-side interactivity" "Build Phoenix LiveView components" ``` ``` -------------------------------- ### Elixir Developer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Elixir Developer agent, specializing in Elixir, Phoenix, Ash Framework, and LiveView development. ```markdown ``` "Create an Ash resource for user management" "Implement real-time features with Phoenix LiveView" "Set up an Ash API with authentication" ``` ``` -------------------------------- ### Flutter Developer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Flutter Developer agent, specializing in Flutter mobile/web apps, GetX state management, and Dart. ```markdown ``` "Build a Flutter app with GetX navigation" "Implement GetX state management" "Create custom Flutter widgets" ``` ``` -------------------------------- ### Database Specialist Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Database Specialist agent, focusing on PostgreSQL optimization, Ash/Ecto performance tuning, and query optimization. ```markdown ``` "Optimize this slow Ash query" "Design optimal indexes for our query patterns" "Fix N+1 query problems in Phoenix" "Choose the best column types and keys for performance" ``` ``` -------------------------------- ### Authentication API - Example Authenticated Request Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Demonstrates how to make an authenticated request to the Authentication API using a JWT Bearer token. ```bash curl -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ https://api.myapp.com/v2/users/profile ``` -------------------------------- ### React Native Developer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the React Native Developer agent, covering React Native apps, cross-platform development, and Expo. ```markdown ``` "Create a React Native app with Expo" "Implement native modules" "Build cross-platform components" ``` ``` -------------------------------- ### Project Coordination Intervention Example Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md This markdown example demonstrates a critical project intervention scenario. It lists detected project management issues and the comprehensive solutions the Product Coordinator Agent implements to organize and optimize the project delivery. ```markdown # PROJECT COORDINATION ENFORCER I thoroughly analyze your project organization and provide comprehensive solutions. I see chaos, I present detailed strategies to create order. ## INTERVENTION EXAMPLE 🚨 PROJECT INTERVENTION - YOUR DELIVERY IS BEING OPTIMIZED 🚨 DETECTED CRITICAL PROJECT MANAGEMENT ISSUES: 1. No clear project requirements or scope definition 2. User stories without acceptance criteria (100% ambiguous) 3. Missing technical specifications for implementation 4. No project timeline or milestone tracking 5. Undefined success metrics and KPIs 6. Poor stakeholder communication and alignment 7. No risk assessment or mitigation planning 8. Missing change management process 9. Unclear roles and responsibilities 10. No documentation standards or templates I'M NOT ASKING - I'M ORGANIZING EVERYTHING NOW: βœ… Creating comprehensive Product Requirements Document (PRD) βœ… Writing detailed user stories with INVEST criteria βœ… Generating technical specifications for all features βœ… Establishing project timeline with critical path analysis βœ… Defining success metrics and KPI tracking system βœ… Implementing stakeholder communication plan βœ… Conducting comprehensive risk assessment βœ… Setting up change management workflow βœ… Assigning clear roles and responsibilities matrix βœ… Creating documentation standards and templates BONUS PROJECT IMPROVEMENTS I'M ALSO MAKING: - Sprint planning with story point estimation - Burndown charts and velocity tracking - Stakeholder feedback loops and review cycles - Quality gates and definition of done - Release planning and deployment strategy - Post-mortem process for continuous improvement Your project will be delivered on time, on budget, and exceed expectations. This will significantly improve your project delivery and coordination. ``` -------------------------------- ### Agent Selection Guide for Backend Development Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_SUMMARY.md This guide details the agents recommended for backend development tasks, including Elixir/Phoenix applications, database management, API implementation, and DevOps. ```APIDOC Agent Selection Guide: For Backend Development: 1. Use elixir-developer for Phoenix applications. 2. Use database-specialist for database design and optimization. 3. Use api-designer β†’ api-implementer for APIs. 4. Use devops-engineer for deployment. ``` -------------------------------- ### Agent Selection Guide for Frontend Development Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_SUMMARY.md This guide specifies the agents for frontend development, covering UX design and platform-specific agents for web, SvelteKit, Flutter, and React Native. ```APIDOC Agent Selection Guide: For Frontend Development: 1. Use ux-designer for design specifications. 2. Choose platform-specific agent: - Use web-developer for web applications. - Use sveltekit-developer for SvelteKit. - Use flutter-developer for mobile/web. - Use reactnative-developer for React Native. ``` -------------------------------- ### Ash Migration Codegen Best Practice Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash_postgres.md Example of using `mix ash.codegen` to generate migration files for resource changes with descriptive names. ```bash mix ash.codegen --name add_user_roles mix ash.codegen --name implement_post_tagging ``` -------------------------------- ### Agent Selection Guide for Quality & Testing Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_SUMMARY.md This guide outlines the agents recommended for ensuring code quality and implementing testing strategies, including test architecture, implementation, code review, and performance optimization. ```APIDOC Agent Selection Guide: For Quality & Testing: 1. Use test-architect for test strategy. 2. Use test-implementer for test creation. 3. Use code-reviewer for code review. 4. Use performance-optimizer for optimization. ``` -------------------------------- ### Authentication API - Error Handling Example Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Illustrates the standard JSON format for API error responses, adhering to RFC 7807 Problem Details. ```json { "type": "https://api.myapp.com/errors/validation-error", "title": "Validation Error", "status": 400, "detail": "Request validation failed", "instance": "/api/v2/users/register", "errors": [ { "field": "email", "code": "INVALID_FORMAT", "message": "Email format is invalid" } ] } ``` -------------------------------- ### API Documenter Agent Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Responsible for generating API documentation, integration guides, and examples. ```APIDOC Document our REST API endpoints Create Postman collection Write API integration guide ``` -------------------------------- ### Authentication API - Register New User (cURL) Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Shows how to register a new user via the API using a cURL command, including the request body and headers. ```bash curl -X POST https://api.myapp.com/v2/users/register \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "SecurePassword123!", "first_name": "John", "last_name": "Doe", "terms_accepted": true }' ``` -------------------------------- ### Authentication API - Register New User (Python Requests) Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md A Python example using the 'requests' library to register a new user, demonstrating POST requests and error checking. ```python import requests def register_user(user_data): url = "https://api.myapp.com/v2/users/register" headers = {"Content-Type": "application/json"} try: response = requests.post(url, json=user_data, headers=headers) response.raise_for_status() return response.json() except requests.RequestException as e: print(f"Registration failed: {e}") raise ``` -------------------------------- ### Brainstormer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Examples of tasks suitable for the Brainstormer agent, focusing on ideation, technology exploration, and risk analysis. ```markdown ``` "Brainstorm 10 different approaches to implement real-time collaboration" "What emerging technologies could enhance our architecture?" "Evaluate risks and alternatives for our migration strategy" "Generate innovative solutions using zen consensus if available" ``` ``` -------------------------------- ### UI/UX Development Flow Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Illustrates the workflow for UI/UX development, starting from design specifications provided by the UX designer to platform-specific implementation. ```mermaid graph LR A[ux-designer] -->|Design specs| B[Platform Agents] B --> C[web-developer] B --> D[sveltekit-developer] B --> E[flutter-developer] B --> F[reactnative-developer] ``` -------------------------------- ### Authentication API - Register New User (JavaScript Fetch) Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Provides a JavaScript example using the Fetch API to register a new user, including error handling for API responses. ```javascript const registerUser = async (userData) => { try { const response = await fetch('/api/v2/users/register', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(userData) }); if (!response.ok) { const error = await response.json(); throw new Error(error.detail); } return await response.json(); } catch (error) { console.error('Registration failed:', error); throw error; } }; ``` -------------------------------- ### Test Architect Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Test Architect agent, focusing on test planning, test strategy, and generating test stubs. ```markdown ``` "Create a test plan for our Ash API" "Design test strategy for Flutter app" "Generate failing test stubs for TDD" ``` ``` -------------------------------- ### UX Designer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the UX Designer agent, focusing on UI/UX design, wireframing, design systems, and user research. ```markdown ``` "Design a user onboarding flow" "Create a design system for our multi-platform app" "Review and improve accessibility" ``` ``` -------------------------------- ### Ontology Specialist Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Ontology Specialist agent, covering RDF, ontologies, semantic web technologies, and knowledge graphs. ```markdown ``` "Create an OWL ontology for our domain" "Write SPARQL queries for our knowledge graph" "Model our data using schema.org vocabulary" ``` ``` -------------------------------- ### Specifications Writer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the Specifications Writer agent, focused on creating product requirements, technical specifications, and implementation plans. ```markdown ``` "Write a PRD for the user profile feature" "Create technical specification from the authentication architecture" "Define acceptance criteria for the payment system" ``` ``` -------------------------------- ### JavaScript/TypeScript SDK - User Registration Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Demonstrates how to install and use the @myapp/api-client SDK in TypeScript to register a new user, including type safety and error handling. ```typescript // Installation npm install @myapp/api-client // Usage import { MyAppClient } from '@myapp/api-client'; const client = new MyAppClient({ baseURL: 'https://api.myapp.com/v2', apiKey: 'your-api-key' }); // Register user with full type safety const registerUser = async () => { try { const result = await client.users.register({ email: 'user@example.com', password: 'SecurePassword123!', firstName: 'John', lastName: 'Doe', termsAccepted: true }); console.log('User registered:', result.userId); } catch (error) { if (error instanceof ValidationError) { console.error('Validation errors:', error.errors); } else { console.error('Registration failed:', error.message); } } }; ``` -------------------------------- ### Ash Framework Code Generation Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Explains how to use `mix ash.gen.*` tasks for code generation in the Ash Framework and provides guidance on using command-line options like `--yes` and `--dry-run`. ```elixir # Use `mix ash.gen.*` tasks as a basis for code generation when possible. # Check the task docs with `mix help `. # Be sure to use `--yes` to bypass confirmation prompts. # Use `--yes --dry-run` to preview the changes. ``` -------------------------------- ### API Development Flow Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Outlines the API development process, starting with an API designer for specifications, followed by an API implementer, and concluding with an API documenter. ```mermaid graph LR A[api-designer] -->|OpenAPI spec| B[api-implementer] B -->|Implementation| C[api-documenter] ``` -------------------------------- ### DevOps Engineer Agent Tasks Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Example tasks for the DevOps Engineer agent, focusing on CI/CD, AWS infrastructure, Terraform, GitHub Actions, and deployment strategies. ```markdown ``` "Set up GitHub Actions CI/CD pipeline" "Create Terraform modules for AWS infrastructure" "Configure AWS Copilot for microservices" "Implement blue-green deployment on AWS" ``` ``` -------------------------------- ### Creating AshPhoenix Forms Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash_phoenix.md Demonstrates how to create forms for creating or updating Ash resources using AshPhoenix.Form. It also shows how to initialize a form with specific parameters. ```elixir form = AshPhoenix.Form.for_create(MyApp.Blog.Post, :create) post = MyApp.Blog.get_post!(post_id) form = AshPhoenix.Form.for_update(post, :update) form = AshPhoenix.Form.for_create(MyApp.Blog.Post, :create, params: %{title: "Draft Title"} ) ``` -------------------------------- ### API Documentation Outputs Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_DEVELOPMENT_PLAN.md The API Documenter agent produces comprehensive API documentation, including interactive documentation, integration guides, code examples, SDKs, and Postman collections. ```APIDOC API Documentation Outputs: - Interactive API Documentation - Integration Guides - Code Examples - SDKs - Postman Collections ``` -------------------------------- ### Using Calculations Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Provides examples of how to utilize defined calculations, including loading them via code interface options, filtering and sorting based on them, manual query building, and loading on existing records. ```elixir # Using code interface options (preferred) users = MyDomain.list_users!(load: [full_name: [separator: ", "]]) # Filtering and sorting users = MyDomain.list_users( query: [ filter: [full_name: [separator: " ", value: "John Doe"]], sort: [full_name: {[separator: " "], :asc}] ] ) # Manual query building (for complex cases) User |> Ash.Query.load(full_name: [separator: ", "]) |> Ash.read!() # Loading on existing records Ash.load!(users, :full_name) ``` -------------------------------- ### Context7 MCP - Best Practices Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Lists essential documentation and best practices managed by the Context7 MCP, including methodologies, frameworks, risk management, and collaboration patterns. ```yaml essential_docs: - Agile/Scrum methodologies - Project management frameworks - Risk management strategies - Team collaboration patterns - Documentation standards ``` -------------------------------- ### Agent Chaining Example: Fixing Code Quality Issues Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Demonstrates chaining agents to address code quality issues in Elixir, involving code analysis, fixing warnings, and adding tests for the corrected code. ```markdown User: "Our Elixir code has many warnings" 1. @agents/code-reviewer.md - "Analyze all Credo warnings" 2. @agents/elixir-developer.md - "Fix the critical warnings" 3. @agents/test-implementer.md - "Add tests for fixed code" ``` -------------------------------- ### Using Aggregates with Code Interface and Queries Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Shows how to utilize defined aggregates when listing resources, including filtering and sorting based on aggregate values. Also demonstrates manual query building and loading aggregates on existing records. ```elixir # Using code interface options (preferred) users = MyDomain.list_users!( load: [:published_post_count, :total_sales], query: [ filter: [published_post_count: [greater_than: 5]], sort: [published_post_count: :desc] ] ) # Manual query building (for complex cases) User |> Ash.Query.filter(published_post_count > 5) |> Ash.read!() # Loading on existing records Ash.load!(users, :published_post_count) ``` -------------------------------- ### Code Interface Options for Filtering, Loading, and Sorting Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Illustrates the preferred way to pass options like `filter`, `load`, `sort`, and `limit` directly to code interface functions for concise and idiomatic Ash usage. ```elixir # PREFERRED - Concise and idiomatic posts = MyApp.Blog.list_posts!( filter: [status: :published], load: [author: :profile, comments: [:author]], sort: [published_at: :desc], limit: 10 ) # Complex scenarios use the query option users = MyApp.Accounts.list_users!( query: [filter: [active: true], load: [:profile], sort: [created_at: :desc]] ) ``` -------------------------------- ### ADR Generation Example Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/architect.md An example of an automatically generated Architecture Decision Record (ADR) recommending a migration to an event-driven architecture due to system bottlenecks. ```markdown # ADR-001: Immediate Migration to Event-Driven Architecture ## Status: RECOMMENDED (by Architect Agent) ## Context System showing signs of temporal coupling and synchronous bottlenecks. Detection triggered by 5 timeout errors in the last hour. ## Decision Strongly recommending event-driven architecture. This is critical - system health depends on it. ## Consequences - Positive: 10x throughput, resilience, scalability - Negative: 2 days of migration effort (I'll handle it) - Risk: None - I've already tested the approach ## Implementation Complete implementation ready. Awaiting approval. ``` -------------------------------- ### Database Schema for MFA and WebAuthn Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Defines the PostgreSQL schema for storing Multi-Factor Authentication settings, including TOTP secrets, SMS details, WebAuthn credentials, and MFA attempt logs. ```sql -- MFA-related tables CREATE TABLE user_mfa_settings ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, totp_secret VARCHAR(32), -- Base32 encoded secret totp_enabled BOOLEAN DEFAULT FALSE, sms_enabled BOOLEAN DEFAULT FALSE, sms_phone_number VARCHAR(20), sms_phone_verified BOOLEAN DEFAULT FALSE, webauthn_enabled BOOLEAN DEFAULT FALSE, backup_codes JSONB, -- Encrypted recovery codes created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now(), CONSTRAINT unique_user_mfa UNIQUE(user_id), CONSTRAINT valid_phone_format CHECK (sms_phone_number ~ '^\\+[1-9]\\d{1,14}$'), CONSTRAINT totp_secret_format CHECK (totp_secret ~ '^[A-Z2-7]{32}$') ); -- WebAuthn credentials storage CREATE TABLE webauthn_credentials ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, credential_id BYTEA NOT NULL UNIQUE, public_key BYTEA NOT NULL, sign_count BIGINT DEFAULT 0, transports TEXT[], -- Available transports (usb, nfc, ble, internal) created_at TIMESTAMPTZ DEFAULT now(), last_used_at TIMESTAMPTZ, nickname VARCHAR(100), -- User-friendly name for the key CONSTRAINT valid_credential_id CHECK (length(credential_id) >= 16), CONSTRAINT valid_public_key CHECK (length(public_key) >= 32) ); -- MFA authentication attempts for security monitoring CREATE TABLE mfa_attempts ( id BIGSERIAL PRIMARY KEY, user_id UUID NOT NULL REFERENCES users(id), attempt_type VARCHAR(20) NOT NULL, -- 'totp', 'sms', 'webauthn', 'recovery' success BOOLEAN NOT NULL, ip_address INET, user_agent TEXT, created_at TIMESTAMPTZ DEFAULT now(), CONSTRAINT valid_attempt_type CHECK (attempt_type IN ('totp', 'sms', 'webauthn', 'recovery')) ); -- Indexes for performance CREATE INDEX idx_mfa_settings_user ON user_mfa_settings(user_id); CREATE INDEX idx_webauthn_user ON webauthn_credentials(user_id); CREATE INDEX idx_webauthn_credential ON webauthn_credentials(credential_id); CREATE INDEX idx_mfa_attempts_user_time ON mfa_attempts(user_id, created_at DESC); ``` -------------------------------- ### Architecture Overview Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Provides a high-level overview of the project's architecture, illustrating the interaction between the Frontend (SvelteKit), API Gateway (Phoenix), Backend Services, and Database (PostgreSQL). ```text β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Frontend β”‚ β”‚ API Gateway β”‚ β”‚ Backend β”‚ β”‚ (SvelteKit) │◄──►│ (Phoenix) │◄──►│ Services β”‚ β”‚ - PWA β”‚ β”‚ - Rate Limit β”‚ β”‚ - User Mgmt β”‚ β”‚ - Responsive β”‚ β”‚ - Auth β”‚ β”‚ - Notificationsβ”‚ β”‚ - Accessible β”‚ β”‚ - Logging β”‚ β”‚ - Analytics β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Database β”‚ β”‚ (PostgreSQL) β”‚ β”‚ - Read Replicaβ”‚ β”‚ - Encryption β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` -------------------------------- ### Agent Selection Guide for Operations Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_SUMMARY.md This guide details the agents for managing project operations, focusing on security, performance, infrastructure, and overall project management. ```APIDOC Agent Selection Guide: For Operations: 1. Use security-specialist for security review. 2. Use performance-optimizer for performance. 3. Use devops-engineer for infrastructure. 4. Use project-coordinator for management. ``` -------------------------------- ### Comprehensive API Documentation Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Details the creation of complete API documentation covering 234 endpoints, including interactive examples for real-time testing. This ensures seamless integration and clear understanding of API functionalities. ```APIDOC API Documentation: Endpoints: 234 documented Features: - Interactive examples for real-time testing - Clear definition of request/response formats - Detailed parameter descriptions with types and constraints - Error condition handling and explanations Purpose: - Facilitate seamless integration between services. - Provide a clear contract for API consumers. - Enable developers to quickly understand and utilize API functionalities. ``` -------------------------------- ### API Documentation Generation Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md This entry outlines the process of generating API documentation using specialized agents, focusing on creating comprehensive documentation and integration guides. ```APIDOC API Documentation Generation: - api-documenter.md: Creates comprehensive API documentation. - documentation-technical.md: Writes integration guides. Usage: Chain these agents to document a REST API. Example: User: "We need to document our REST API" 1. @agents/api-documenter.md - "Create comprehensive API docs" 2. @agents/documentation-technical.md - "Write integration guides" ``` -------------------------------- ### Agent Collaboration Patterns Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/consolidation/IMPLEMENTATION_RECOMMENDATIONS.md Illustrates the reduction in agent handoffs before and after consolidation, highlighting improved efficiency and reduced context loss. ```markdown Before Consolidation (Complex) ``` brainstormer β†’ solutions-architect β†’ specifications-writer β†’ api-designer β†’ api-implementer β†’ api-documenter β†’ test-architect β†’ test-implementer β†’ code-reviewer ``` After Consolidation (Simplified) ``` architect β†’ product-coordinator β†’ api-specialist β†’ test-engineer ``` ``` -------------------------------- ### Policy Basics: Read and Create Actions Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Provides examples of defining basic policies for read and create actions, including conditions based on record attributes and relationships to the actor. ```elixir policies do # A simple policy that applies to all read actions policy action_type(:read) do # Authorize if record is public authorize_if expr(public == true) # Authorize if actor is the owner authorize_if relates_to_actor_via(:owner) end # A policy for create actions policy action_type(:create) do # Only allow active users to create records forbid_unless actor_attribute_equals(:active, true) # Ensure the record being created relates to the actor authorize_if relating_to_actor(:owner) end end ``` -------------------------------- ### Context7 MCP - Testing Documentation Resources Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/test-engineer.md Lists the documentation resources supported by the Context7 MCP, encompassing guides for ExUnit, property-based testing, Jest/Vitest, Flutter testing, and React Testing Library. ```yaml essential_docs: - ExUnit testing guides - Property-based testing patterns - Jest/Vitest documentation - Flutter test frameworks - React Testing Library ``` -------------------------------- ### Data Engineering Intervention Response Examples Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/data-engineer.md Provides examples of weak and acceptable responses for data engineering interventions, highlighting the difference between a suggestive approach and a direct, action-oriented one. ```text Weak Response (NEVER) "You might want to consider adding an index." Acceptable Response (MINIMUM) "I've added an index to improve query performance." ``` -------------------------------- ### WebAuthn Security Key Registration and Authentication Source: https://github.com/mudspot/prometheus-agents/blob/main/agents/product-coordinator.md Provides functionality for managing hardware security keys using the FIDO2/WebAuthn specification. It includes methods to register a new security key for a user, verifying the registration data and storing the associated credential. It also supports authenticating a user with their registered security key, involving verification against stored credentials. ```elixir defmodule MyApp.Authentication.MFA.WebAuthn do @doc """ Register new security key for user Implements FIDO2/WebAuthn specification Supports multiple keys per user """ def register_key(user_id, registration_data) do with {:ok, credential} <- verify_registration_data(registration_data), # Assumed external function {:ok, _} <- store_credential(user_id, credential) do # Assumed external function {:ok, :key_registered} else {:error, reason} -> {:error, reason} end end @doc """ Authenticate with security key Returns: {:ok, :authenticated} | {:error, :authentication_failed} """ def authenticate_key(user_id, authentication_data) do with {:ok, credentials} <- get_user_credentials(user_id), # Assumed external function {:ok, _} <- verify_authentication(credentials, authentication_data) do # Assumed external function {:ok, :authenticated} else {:error, reason} -> {:error, reason} end end end ``` -------------------------------- ### Revolutionary Workflows: Instant Feature Development Source: https://github.com/mudspot/prometheus-agents/blob/main/README.md Illustrates the automatic coordination of PROACTIVE agents for instant feature development, starting from architectural design to deployment and quality assurance. ```bash @architect # Designs optimal architecture + creates specs ↓ (AUTOMATIC) @backend-developer # Implements with Elixir/Phoenix best practices ↓ (AUTOMATIC) @frontend-developer # Creates exceptional UI across platforms ↓ (AUTOMATIC) @api-specialist # Delivers complete API + documentation ↓ (AUTOMATIC) @test-engineer # Implements exhaustive testing ↓ (AUTOMATIC) @quality-specialist # Enforces security + performance ↓ (AUTOMATIC) @devops-engineer # Automates deployment + infrastructure ``` -------------------------------- ### Technical Documentation Agent Source: https://github.com/mudspot/prometheus-agents/blob/main/docs/agents/AGENT_USAGE_GUIDE.md Used for creating technical documentation, README files, and architecture documentation. ```markdown Write technical documentation for our system Create developer onboarding guide Document deployment process ``` -------------------------------- ### AshPhoenix Form Submission and Error Handling Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash_phoenix.md Example of submitting a form in AshPhoenix and handling both successful submissions and validation errors. ```elixir def handle_event("submit", %{"form" => params}, socket) do case AshPhoenix.Form.submit(socket.assigns.form, params: params) do {:ok, post} -> # Success path {:noreply, success_path(socket, post)} {:error, form} -> # Show validation errors {:noreply, assign(socket, form: form)} end end ``` -------------------------------- ### Call Domain with Extra Inputs Source: https://github.com/mudspot/prometheus-agents/blob/main/rules/ash.md Demonstrates how to call a domain action, passing additional inputs as a map. This is preferred over defining optional arguments for flexibility. ```elixir Domain.create!(field1_value, %{field2: field2_value}, actor: current_user) ```