### Install and run cicaddy with a plugin Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Demonstrates the installation of both cicaddy and a custom plugin, followed by running cicaddy. Plugins are automatically discovered upon installation. ```bash pip install cicaddy my-cicaddy-plugin cicaddy run --env-file .env ``` -------------------------------- ### Install cicaddy using pip Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Installs the cicaddy package and its dependencies. This is the primary method for setting up the tool in your environment. ```bash pip install cicaddy ``` -------------------------------- ### YAML Task Definition Format Example Source: https://context7.com/waynesun09/cicaddy/llms.txt Provides an example of a YAML file defining a structured task for security scanning. It showcases the format for specifying task metadata, inputs with environment variable resolution, outputs, required and forbidden tools, constraints, and context. This format is used by the TaskLoader. ```yaml # examples/my_analysis_task.yaml name: security_scan description: Scan repository for security vulnerabilities type: code_review version: "1.0" persona: > expert security engineer specializing in vulnerability detection and secure coding practices for {{PROJECT_NAME}}. inputs: - name: project_name env_var: PROJECT_NAME required: true description: "Project to analyze" - name: scan_depth env_var: SCAN_DEPTH default: "deep" description: "Scan depth: quick, standard, deep" - name: code_changes format: diff description: "Git diff content to analyze" outputs: - name: vulnerability_summary description: "Overview of discovered vulnerabilities" required: true format: table - name: recommendations description: "Remediation steps for each issue" required: true format: list tools: servers: - security-scanner - local required_tools: - scan_dependencies - read_file forbidden_tools: - delete_file constraints: - "Scan all dependencies for known CVEs" - "Check for hardcoded secrets" - "Analyze authentication patterns" reasoning: react output_format: markdown context: | **Project:** {{PROJECT_NAME}} **Scan Depth:** {{SCAN_DEPTH}} **Focus Areas:** dependency vulnerabilities, secret detection, auth patterns ``` -------------------------------- ### Validate cicaddy configuration Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Validates the cicaddy configuration, checking for potential issues or inconsistencies. This helps ensure the setup is correct before running workflows. ```bash # Validate configuration cicaddy validate --env-file .env ``` -------------------------------- ### Register and Execute Local Tools with ToolRegistry (Python) Source: https://context7.com/waynesun09/cicaddy/llms.txt Demonstrates how to create and use a ToolRegistry for managing and executing local tools. It shows how to initialize a registry with file tools, list available tools, retrieve tools in MCP format, and call a specific tool with arguments. Dependencies include cicaddy.tools. ```python from cicaddy.tools import ToolRegistry, tool, create_local_file_registry # Create registry with built-in file tools registry = create_local_file_registry(working_dir="/path/to/project") # List available tools tool_names = registry.list_tool_names() # Returns: ['glob_files', 'read_file'] # Get tools in MCP format mcp_tools = registry.get_tools() # Returns: [ # {"name": "glob_files", "description": "...", "inputSchema": {...}}, # {"name": "read_file", "description": "...", "inputSchema": {...}} # ] # Call a tool result = await registry.call_tool( tool_name="read_file", arguments={"file_path": "src/main.py"} ) # result = { # "content": "import os\n...", # "tool": "read_file", ``` -------------------------------- ### Integrate AI Providers with Factory and Tool Calling in Python Source: https://context7.com/waynesun09/cicaddy/llms.txt Shows how to create and utilize AI providers using a factory pattern, including automatic retries and token management. It covers simple chat completions and advanced scenarios with tool calling. Dependencies include cicaddy.ai_providers.factory, cicaddy.ai_providers.base, and cicaddy.config.settings. ```python from cicaddy.ai_providers.factory import create_provider, get_provider_config from cicaddy.ai_providers.base import ProviderMessage, ProviderResponse from cicaddy.config.settings import load_settings # async def main(): # # Create provider from settings # settings = load_settings() # config = get_provider_config(settings) # provider = create_provider("gemini", config) # await provider.initialize() # # Simple chat completion # messages = [ # ProviderMessage(content="Analyze this code for security issues", role="user") # ] # response = await provider.chat_completion(messages) # # print(f"Response content: {response.content}") # # print(f"Model used: {response.model}") # # print(f"Usage: {response.usage}") # # Chat completion with tool calling # tools = [ # { # "name": "read_file", # "description": "Read a file from the filesystem", # "inputSchema": { # "type": "object", # "properties": { # "path": {"type": "string", "description": "File path"} # }, # "required": ["path"] # } # } # ] # response_with_tools = await provider.chat_completion(messages, tools=tools) # if response_with_tools.tool_calls: # for tool_call in response_with_tools.tool_calls: # print(f"Tool: {tool_call['name']}, Args: {tool_call['arguments']}") # await provider.shutdown() # import asyncio # asyncio.run(main()) ``` -------------------------------- ### Implement Cicaddy Platform Plugins Source: https://context7.com/waynesun09/cicaddy/llms.txt Illustrates how to extend Cicaddy with platform-specific plugins, such as a GitLab agent. It shows defining agent logic, registering agents and detectors, and configuring CLI arguments via entry points in `pyproject.toml`. ```python # my_plugin/plugin.py from cicaddy.agent.base import BaseAIAgent from cicaddy.agent.factory import AgentFactory from cicaddy.cli.arg_mapping import ArgMapping class GitLabAgent(BaseAIAgent): """GitLab-specific agent implementation.""" async def _setup_platform_integration(self): from my_plugin.gitlab import GitLabClient self.gitlab = GitLabClient(self.settings.gitlab_token) async def get_analysis_context(self): mr = await self.gitlab.get_merge_request(self.settings.merge_request_iid) return {"project": {"name": mr["project"]["name"]}, "mr": mr} def build_analysis_prompt(self, context): return f"Review MR: {context['mr']['title']}" def get_session_id(self): return f"gitlab-mr-{self.settings.merge_request_iid}" def register_agents(): """Register GitLab agents with the factory.""" AgentFactory.register("gitlab_mr", GitLabAgent) AgentFactory.register_detector(detect_gitlab_mr, priority=30) def detect_gitlab_mr(settings): """Detect GitLab MR context.""" import os if os.getenv("CI_MERGE_REQUEST_IID"): return "gitlab_mr" return None def get_cli_args(): """Return additional CLI arguments.""" return [ ArgMapping( cli_arg="--gitlab-token", env_var="GITLAB_TOKEN", help_text="GitLab API token" ), ArgMapping( cli_arg="--mr-iid", env_var="CI_MERGE_REQUEST_IID", help_text="Merge request IID" ) ] ``` ```toml # pyproject.toml for the plugin [project.entry-points."cicaddy.agents"] gitlab = "my_plugin.plugin:register_agents" [project.entry-points."cicaddy.cli_args"] gitlab = "my_plugin.plugin:get_cli_args" [project.entry-points."cicaddy.settings_loader"] gitlab = "my_plugin.config:load_gitlab_settings" ``` -------------------------------- ### Configure Cicaddy Settings Programmatically Source: https://context7.com/waynesun09/cicaddy/llms.txt Demonstrates how to load, access, and customize Cicaddy's settings programmatically. It covers accessing core settings, server configurations, and creating custom settings classes. ```python from cicaddy.config.settings import CoreSettings, Settings, load_settings, MCPServerConfig # Load settings from environment settings = load_settings() # Access configuration values print(f"AI Provider: {settings.ai_provider}") print(f"Model: {settings.ai_model}") print(f"Max iterations: {settings.max_infer_iters}") print(f"Execution time limit: {settings.max_execution_time}s") # Get MCP server configurations mcp_servers = settings.get_mcp_servers() for server in mcp_servers: print(f"Server: {server.name} ({server.protocol})") # Get Slack webhook URLs webhooks = settings.get_slack_webhook_urls() # Get email configuration email_config = settings.get_email_config() if email_config: print(f"Recipients: {email_config['recipients']}") # Get enabled tasks tasks = settings.get_enabled_tasks() # Create custom settings class MySettings(CoreSettings): custom_api_url: str = Field(None, validation_alias="CUSTOM_API_URL") custom_timeout: int = Field(30, validation_alias="CUSTOM_TIMEOUT") my_settings = MySettings() ``` -------------------------------- ### Execute AI Workflows with Execution Engine (Python) Source: https://context7.com/waynesun09/cicaddy/llms.txt Demonstrates how to configure and use the ExecutionEngine to run multi-step AI workflows. It includes setting execution limits, defining messages, listing available tools, executing a turn, and accessing the results and history. Dependencies include cicaddy.execution.engine, cicaddy.execution.token_aware_executor, and cicaddy.ai_providers.base. ```python from cicaddy.execution.engine import ExecutionEngine from cicaddy.execution.token_aware_executor import ExecutionLimits from cicaddy.ai_providers.base import ProviderMessage # Configure execution limits limits = ExecutionLimits( max_infer_iters=10, # Maximum AI iterations max_tokens_total=128000, # Total token budget max_tokens_per_iteration=8000, max_tokens_per_tool_result=4096, max_execution_time=600 # 10 minutes ) # Create execution engine engine = ExecutionEngine( ai_provider=provider, mcp_manager=mcp_manager, local_tool_registry=tool_registry, session_id="analysis-session-001", execution_limits=limits, context_safety_factor=0.85 # Use 85% of token budget ) # Execute a turn with tool calling messages = [ ProviderMessage( content="Query the database for DORA metrics and generate a report", role="user" ) ] available_tools = await mcp_manager.list_tools("devlake-mcp") turn = await engine.execute_turn( messages=messages, available_tools=available_tools, max_infer_iters=10 ) # Access results print(f"Turn ID: {turn.turn_id}") print(f"Output: {turn.output_message}") print(f"Steps executed: {len(turn.steps)}") print(f"Execution summary: {turn.execution_summary}") # Get execution history history = engine.get_turn_history() ``` -------------------------------- ### Register cicaddy plugin entry points in pyproject.toml Source: https://github.com/waynesun09/cicaddy/blob/main/README.md TOML configuration specifying how cicaddy discovers and loads plugin components. This includes agents, CLI arguments, and settings loaders. ```toml [project.entry-points."cicaddy.agents"] my_platform = "my_plugin.plugin:register_agents" [project.entry-points."cicaddy.cli_args"] my_platform = "my_plugin.plugin:get_cli_args" [project.entry-points."cicaddy.settings_loader"] my_platform = "my_plugin.config:load_settings" ``` -------------------------------- ### Register Custom Tools with Cicaddy Source: https://context7.com/waynesun09/cicaddy/llms.txt Demonstrates how to register custom tools with Cicaddy using both decorators and direct registration. This allows extending Cicaddy's capabilities with user-defined functions. ```python # Register custom tool using decorator @tool(name="analyze_code", description="Analyze code quality") def analyze_code(file_path: str, metrics: list = None) -> dict: """Analyze code and return quality metrics.""" return {"file": file_path, "issues": [], "score": 95} registry.register(analyze_code) # Register function directly def custom_tool(input_data: str) -> str: return f"Processed: {input_data}" registry.register(custom_tool, name="process_data", description="Process input data") ``` -------------------------------- ### Run Cicaddy CLI Commands Source: https://context7.com/waynesun09/cicaddy/llms.txt Execute Cicaddy AI agents using various command-line arguments. Supports environment file loading, provider and agent type specification, dry runs, configuration display, validation, and version checking. ```bash # Run with environment file cicaddy run --env-file .env # Run with specific provider and agent type cicaddy run --agent-type task --ai-provider gemini --log-level DEBUG # Dry run to preview configuration cicaddy run --env-file .env --dry-run # Show current configuration cicaddy config show --env-file .env # Validate configuration before running cicaddy validate --env-file .env # Display version cicaddy version ``` -------------------------------- ### Show cicaddy configuration Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Displays the current cicaddy configuration, potentially loaded from an environment file. Useful for debugging and verifying settings. ```bash # Show configuration cicaddy config show --env-file .env ``` -------------------------------- ### Manage MCP Client Connections with Multiple Protocols in Python Source: https://context7.com/waynesun09/cicaddy/llms.txt Illustrates how to connect to MCP servers using various transport protocols including stdio, SSE, HTTP, and WebSocket. It details the configuration of servers, initialization of the client manager, and methods for listing servers, tools, and calling remote tools. Requires cicaddy.mcp_client.client and cicaddy.config.settings. ```python from cicaddy.mcp_client.client import OfficialMCPClientManager from cicaddy.config.settings import MCPServerConfig # async def main(): # # Define MCP server configurations # servers = [ # MCPServerConfig( # name="devlake-mcp", # protocol="stdio", # command="uv", # args=["run", "python", "-m", "devlake_mcp"], # env_vars={"DATABASE_URL": "mysql://localhost/devlake"}, # timeout=60, # retry_count=3 # ), # MCPServerConfig( # name="github-mcp", # protocol="sse", # endpoint="https://mcp.github.example.com/sse", # headers={"Authorization": "Bearer token123"}, # connection_timeout=10.0, # read_timeout=30.0 # ) # ] # # Initialize manager # manager = OfficialMCPClientManager(servers, ssl_verify=True) # await manager.initialize() # # List connected servers # server_names = manager.get_server_names() # print(f"Connected servers: {server_names}") # # List tools from a specific server # tools = await manager.list_tools("devlake-mcp") # print(f"Tools from devlake-mcp: {tools}") # # Call a tool # result = await manager.call_tool( # server_name="devlake-mcp", # tool_name="execute_query", # arguments={"query": "SELECT COUNT(*) FROM deployments"} # ) # print(f"Tool call result: {result}") # await manager.cleanup() # import asyncio # asyncio.run(main()) ``` -------------------------------- ### Configure Cicaddy Environment Variables Source: https://context7.com/waynesun09/cicaddy/llms.txt Set up Cicaddy using environment variables in a .env file. This includes AI provider details, agent settings, MCP server configurations, DSPy task file paths, Slack notifications, and local tool enablement. ```bash # AI Provider Configuration AI_PROVIDER=gemini # Options: gemini, openai, claude AI_MODEL=gemini-3-flash-preview # Model name for the provider GEMINI_API_KEY=your-gemini-key OPENAI_API_KEY=your-openai-key ANTHROPIC_API_KEY=your-anthropic-key # Agent Configuration AGENT_TYPE=task # Options: task, merge_request, branch_review MAX_INFER_ITERS=10 # Maximum AI planning iterations MAX_EXECUTION_TIME=600 # Maximum execution time in seconds # MCP Server Configuration (JSON array) MCP_SERVERS_CONFIG='[ { "name": "devlake-mcp", "protocol": "stdio", "command": "uv", "args": ["run", "python", "-m", "devlake_mcp"], "env": {"DATABASE_URL": "mysql://user:pass@host/db"} }, { "name": "github-mcp", "protocol": "sse", "endpoint": "https://mcp.example.com/sse", "headers": {"Authorization": "Bearer token"} } ]' # DSPy Task File (takes precedence over AI_TASK_PROMPT) AI_TASK_FILE=examples/dora_metrics_task.yaml # Slack Notifications SLACK_WEBHOOK_URLS='["https://hooks.slack.com/services/xxx/yyy/zzz"]' # Local Tools ENABLE_LOCAL_TOOLS=true LOCAL_TOOLS_WORKING_DIR=/path/to/workspace ``` -------------------------------- ### Run cicaddy with CLI arguments Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Executes cicaddy by providing configuration directly through command-line arguments. This allows for dynamic overrides of environment settings. ```bash # Run with CLI arguments cicaddy run --ai-provider gemini --agent-type task --log-level DEBUG ``` -------------------------------- ### Implement Custom AI Agent with BaseAIAgent in Python Source: https://context7.com/waynesun09/cicaddy/llms.txt Demonstrates how to extend the BaseAIAgent class to create a custom AI agent. This involves setting up platform integration, gathering analysis context, building prompts, and managing session IDs. It requires the cicaddy.agent.base and cicaddy.config.settings modules. ```python from cicaddy.agent.base import BaseAIAgent from cicaddy.config.settings import Settings from datetime import datetime # Assuming MyPlatformClient is defined elsewhere class MyPlatformClient: def __init__(self, token): self.token = token async def get_project(self): # Placeholder for actual client logic return {"name": "MyProject", "id": "123"} class MyPlatformAgent(BaseAIAgent): def __init__(self, settings: Settings): super().__init__(settings) self.platform_client = None async def _setup_platform_integration(self): """Setup platform-specific integration.""" # Initialize platform-specific clients self.platform_client = MyPlatformClient( token=self.settings.platform_token ) async def get_analysis_context(self): """Gather analysis context from platform.""" project_data = await self.platform_client.get_project() return { "project": { "name": project_data["name"], "id": project_data["id"] }, "timestamp": datetime.now().isoformat(), "platform_available": True } def build_analysis_prompt(self, context): """Build AI analysis prompt from context.""" mcp_tools = context.get("mcp_tools", []) tool_names = [t["name"] for t in mcp_tools] return f""" Analyze project: {context['project']['name']} Available tools: {', '.join(tool_names)} Provide a comprehensive analysis of the project. """ def get_session_id(self): """Generate unique session identifier.""" return f"my-platform-{datetime.now().strftime('%Y%m%d-%H%M%S')}" # Usage example (assuming 'settings' is an initialized Settings object) # async def main(): # settings = Settings() # agent = MyPlatformAgent(settings) # await agent.initialize() # results = await agent.analyze() # await agent.cleanup() # import asyncio # asyncio.run(main()) ``` -------------------------------- ### Run cicaddy with environment file Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Executes cicaddy using configuration specified in a .env file. This is a common way to manage settings for CI environments. ```bash # Run with environment file cicaddy run --env-file .env ``` -------------------------------- ### Load and Validate DSPy Tasks with TaskLoader (Python) Source: https://context7.com/waynesun09/cicaddy/llms.txt Illustrates how to load and validate YAML task definitions using the TaskLoader. It covers resolving environment variables, accessing task details, and building prompts with runtime context and available tools. Key dependencies include cicaddy.dspy.task_loader and cicaddy.dspy.prompt_builder. ```python from cicaddy.dspy.task_loader import TaskLoader, TaskLoadError from cicaddy.dspy.prompt_builder import PromptBuilder # Load task from YAML file loader = TaskLoader(base_path="/path/to/tasks") task, resolved_inputs = loader.load("dora_metrics_task.yaml") # Task definition structure print(f"Name: {task.name}") print(f"Type: {task.type}") print(f"Inputs: {[i.name for i in task.inputs]}") print(f"Outputs: {[o.name for o in task.outputs]}") print(f"Constraints: {task.constraints}") print(f"Required tools: {task.tools.required_tools}") # Build prompt from task definition builder = PromptBuilder(task, resolved_inputs=resolved_inputs) # Add runtime context and available tools prompt = builder.build( context={ "project": {"name": "MyProject", "id": "123"}, "timestamp": "2024-01-15T10:30:00Z", "scope": "recent_changes" }, mcp_tools=[ {"name": "execute_query", "description": "Run SQL", "server": "devlake"}, {"name": "read_file", "description": "Read file", "server": "local"} ] ) # Get resolved input values input_values = builder.get_input_values() # Returns: {"analysis_days": "30", "project_name": "MyProject"} ``` -------------------------------- ### Create and Manage Agents with AgentFactory (Python) Source: https://context7.com/waynesun09/cicaddy/llms.txt Utilize the AgentFactory in Python to create AI agents from environment settings or explicit configurations. It supports registering custom agent types and detectors, validating requirements, and retrieving available agent types. ```python from cicaddy.agent.factory import AgentFactory, create_agent_from_environment from cicaddy.config.settings import load_settings # Create agent from environment (recommended) agent = create_agent_from_environment() await agent.initialize() results = await agent.analyze() await agent.cleanup() # Create agent with explicit settings settings = load_settings() agent = AgentFactory.create_agent(settings) # Get available agent types available_types = AgentFactory.get_available_agent_types() # Returns: ['merge_request', 'branch_review', 'task', 'cron'] # Validate agent requirements is_valid = AgentFactory.validate_agent_requirements("merge_request", settings) # Register custom agent type from cicaddy.agent.base import BaseAIAgent class CustomAgent(BaseAIAgent): async def get_analysis_context(self): return {"project": {"name": "MyProject"}} def build_analysis_prompt(self, context): return f"Analyze project: {context['project']['name']}" def get_session_id(self): return "custom-session-123" AgentFactory.register("custom", CustomAgent) # Register custom type detector def detect_custom_type(settings): if hasattr(settings, "custom_flag") and settings.custom_flag: return "custom" return None AgentFactory.register_detector(detect_custom_type, priority=30) ``` -------------------------------- ### Send Slack Notifications with Cicaddy Source: https://context7.com/waynesun09/cicaddy/llms.txt Shows how to send basic and rich notifications to Slack channels using Cicaddy's SlackNotifier and RichSlackNotifier. It covers sending simple messages, error notifications, and formatted reports. ```python from cicaddy.notifications.slack import SlackNotifier from cicaddy.notifications.rich_slack import RichSlackNotifier # Basic Slack notifier notifier = SlackNotifier( webhook_urls=["https://hooks.slack.com/services/xxx/yyy/zzz"], ssl_verify=True ) # Send simple notification await notifier.send_notification( message="Analysis completed successfully!", username="Cicaddy", icon_emoji=":robot_face:" ) # Send error notification await notifier.send_error_notification( error="Database connection failed", context={ "project_name": "MyProject", "error_type": "connection_error", "retry_count": 3 } ) # Rich Slack notifier with formatted reports rich_notifier = RichSlackNotifier(webhook_urls, ssl_verify=True) # Send formatted analysis report await rich_notifier.send_formatted_report( report={ "report_id": "analysis_20240115_103000", "generated_at": "2024-01-15T10:30:00Z", "agent_type": "TaskAgent", "project": "MyProject" }, analysis_result={ "status": "success", "ai_analysis": "Analysis found 3 issues...", "execution_time": 45.2 }, trends={} ) ``` -------------------------------- ### Metrics Grid Component Styling Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Styles a grid layout for displaying metric cards. It uses CSS Grid for responsive columns and applies glass card effects with hover interactions, including lifting the card and adjusting its shadow and border color on hover. ```css /* ================================================================ METRICS GRID — glass cards with hover lift ================================================================ */ .metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; } .metric-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast); } .metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-default); } .metric-value { font-size: 1.75rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.03em; } .metric-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.35rem; text-transform: uppercase; letter-spa ``` -------------------------------- ### Base Reset and Typography Styles Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Applies a universal box-sizing reset and sets base styles for the body element. It defines the primary font family, background color, text color, line height, and ensures proper font smoothing for readability across different browsers. ```css /* ================================================================ BASE RESET & TYPOGRAPHY ================================================================ */ *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg-base); color: var(--text-primary); line-height: 1.7; min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } ``` -------------------------------- ### Extend Cicaddy with a Platform-Specific Agent (Python) Source: https://github.com/waynesun09/cicaddy/blob/main/CLAUDE.md This snippet demonstrates how to extend Cicaddy by creating a new platform-specific agent. It involves subclassing `BaseAIAgent`, overriding platform integration methods, and registering the new agent with the `AgentFactory`. Dependencies include `cicaddy.agent.base` and `cicaddy.agent.factory`. ```python from cicaddy.agent.base import BaseAIAgent from cicaddy.agent.factory import AgentFactory class MyPlatformAgent(BaseAIAient): async def _setup_platform_integration(self): # Set up platform-specific analyzer self.gitlab_analyzer = MyAnalyzer(...) async def _gather_context(self): ... async def _build_prompt(self, context): ... AgentFactory.register("my_platform", MyPlatformAgent) ``` -------------------------------- ### Container Layout Styles Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Defines a responsive container class to center content and manage its maximum width. It applies padding on the sides and ensures the container is centered horizontally within its parent element. ```css /* ================================================================ LAYOUT ================================================================ */ .container { max-width: 1320px; margin: 0 auto; padding: 2.5rem 2rem; } ``` -------------------------------- ### Back Link Component Styling Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Styles a 'back link' component for navigation. It uses flexbox to align an icon and text, applies a subtle color, and transitions the color on hover to the primary accent color for visual feedback. ```css /* ================================================================ BACK LINK ================================================================ */ .back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; margin-bottom: 1.25rem; transition: color var(--transition-fast); } .back-link:hover { color: var(--accent-primary); } ``` -------------------------------- ### Header Component with Gradient Glass Effect Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Styles a header component featuring a gradient glass effect. It uses a linear gradient background, subtle borders, rounded corners, and a shadow for depth. It also includes styles for header top elements like team badges and report dates. ```css /* ================================================================ HEADER — gradient glass effect ================================================================ */ .header { background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-raised) 50%, rgba(109, 159, 255, 0.04) 100%); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 2rem 2.25rem; margin-bottom: 2rem; box-shadow: var(--shadow-md); } .header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; } .team-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(109, 159, 255, 0.08); border: 1px solid rgba(109, 159, 255, 0.25); padding: 0.4rem 0.9rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; color: var(--accent-primary); letter-spacing: 0.02em; } .report-date { font-size: 0.8rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; } h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.02em; } h1 span { color: var(--accent-primary); } .subtitle { color: var(--text-secondary); font-size: 0.95rem; } ``` -------------------------------- ### Define cicaddy plugin callable for agents Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Python code defining a function to register new agents with the AgentFactory. This allows extending cicaddy's agent capabilities. ```python def register_agents(): from cicaddy.agent.factory import AgentFactory from my_plugin.agent import MergeRequestAgent, detect_agent_type AgentFactory.register("merge_request", MergeRequestAgent) AgentFactory.register_detector(detect_agent_type, priority=40) ``` -------------------------------- ### CSS Variables for Deep Space Theme Source: https://github.com/waynesun09/cicaddy/blob/main/examples/templates/report_template.html Defines CSS custom properties for the 'Deep Space' theme, focusing on dark mode best practices. It includes variables for backgrounds, surfaces, accents, text colors, borders, shadows, radii, and transitions, ensuring readability and accessibility. ```css /* ================================================================ CSS VARIABLES — Deep Space Theme Avoids pure black (#000) and pure white (#fff) per dark-mode best practices. Accent colors are slightly desaturated to reduce glare on dark surfaces while maintaining >= 4.5:1 WCAG AA contrast. ================================================================ */ :root { /* Surfaces — layered depth via lightness steps */ --bg-base: #0c0e16; /* deepest background */ --bg-surface: #13161f; /* cards, sections */ --bg-surface-raised: #1a1d2b; /* elevated elements, table headers */ --bg-surface-overlay: #222638; /* modals, popovers */ /* Accent palette — desaturated for dark-mode comfort */ --accent-primary: #6d9fff; /* soft blue — links, primary actions */ --accent-secondary: #5cc8d4; /* teal — info, neutral metrics */ --accent-success: #4ade80; /* green — healthy, pass */ --accent-warning: #fbbf24; /* amber — caution */ --accent-danger: #f87171; /* coral red — critical, fail */ --accent-purple: #a78bfa; /* violet — highlights, tags */ /* Text — off-whites for readability without glare */ --text-primary: #e8eaed; /* main body (contrast ~13:1 on base) */ --text-secondary: #9ba3b5; /* labels, descriptions */ --text-muted: #5f6880; /* footnotes, timestamps */ /* Borders & dividers */ --border-subtle: rgba(109, 159, 255, 0.12); --border-default: rgba(109, 159, 255, 0.20); /* Shadows */ --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5); --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6); /* Radii */ --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; /* Transitions */ --transition-fast: 150ms ease; --transition-normal: 250ms ease; } ``` -------------------------------- ### Define cicaddy plugin callable for CLI arguments Source: https://github.com/waynesun09/cicaddy/blob/main/README.md Python code defining a function to register custom command-line arguments for a cicaddy plugin. This enhances the CLI interface for specific functionalities. ```python def get_cli_args(): from cicaddy.cli.arg_mapping import ArgMapping return [ ArgMapping(cli_arg="--mr-iid", env_var="CI_MERGE_REQUEST_IID", help_text="Merge request IID"), ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.