Go (Golang) w/ Fiber & Clean Arch
High-performance Go web services using Fiber and Clean Architecture.
Agent Rules
How to use
- Copy the code block above.
- Open Antigravity IDE.
- Go to Settings > Agent > System Prompt (or create a
.cursorrulesfile). - Paste the rules and save.
Understanding This Agent
This specialized agent prompt is designed to enhance Antigravity IDE's AI capabilities for specific development tasks. By configuring these rules, you're essentially teaching the AI how to think and approach problems in your domain. The agent leverages proven architectural patterns, performance optimization techniques, and security best practices to deliver production-ready code that follows industry standards.
When to Use This Agent
Deploy this agent when working on projects that require deep expertise in the specific technologies and patterns it covers. The agent provides opinionated guidance based on industry best practices and modern development standards. It's particularly effective when you need consistency across team members or when learning new frameworks.
New Projects
Perfect for establishing strong architectural foundations from day one. Prevents technical debt and ensures scalable code structure.
Team Onboarding
Helps new team members quickly adopt established coding patterns and reduces the learning curve for complex frameworks.
Legacy Modernization
Excellent for refactoring legacy systems to modern patterns, ensuring consistent migration to current best practices.
Key Benefits
- Consistent code quality and architecture decisions across all project phases
- Reduced cognitive load by following established patterns and conventions
- Faster development with framework-specific optimizations and shortcuts
- Built-in best practices for security, performance, and maintainability
- Automated enforcement of team coding standards and review guidelines
- Reduced debugging time through preventive coding patterns
- Enhanced collaboration through shared understanding of codebase structure
Advanced Implementation Strategies
Performance Optimization Techniques
This agent incorporates advanced performance optimization strategies specific to the target framework. It understands the nuances of bundle optimization, lazy loading patterns, and memory management techniques that can significantly impact application performance in production environments.
Code Splitting Strategies
Automatically applies optimal code splitting patterns based on route boundaries, feature modules, and dependency analysis. Reduces initial bundle size and improves first-load performance metrics.
Memory Management
Implements proper cleanup patterns, prevents memory leaks through subscription management, and optimizes component lifecycle methods for minimal memory footprint.
Caching Strategies
Leverages browser caching, service worker patterns, and application-level caching to minimize network requests and improve user experience consistency.
Security Implementation
Security is integrated into every aspect of the development process. The agent ensures that security considerations are not an afterthought but are built into the foundation of your application architecture. From input validation to authentication patterns, every recommendation follows OWASP guidelines and industry standards.
Input Validation
Implements comprehensive input validation at multiple layers, preventing injection attacks and ensuring data integrity throughout the application flow.
Authentication Patterns
Applies secure authentication flows, proper session management, and authorization patterns that scale with application complexity while maintaining security standards.
Data Protection
Ensures sensitive data is properly encrypted, implements secure storage patterns, and follows privacy best practices for regulatory compliance.
Scalability Considerations
The agent is designed with enterprise scalability in mind. It understands how small architectural decisions made early in development can impact application performance and maintainability as the codebase grows. Every pattern and recommendation is evaluated for its long-term scalability implications.
- Modular architecture patterns that support team collaboration and feature isolation
- Database design patterns that handle increasing data volumes efficiently
- API design strategies that accommodate growing request loads and feature complexity
- Monitoring and logging implementations that provide visibility at scale
- Error handling patterns that maintain system stability under high load conditions
Team Collaboration and Workflow
Code Review Integration
This agent enhances team collaboration by establishing consistent patterns that make code reviews more effective. When all team members follow the same architectural principles and coding patterns, reviews can focus on business logic and optimization rather than style and structure debates.
Consistent Patterns
Establishes shared conventions for file organization, naming patterns, and architectural decisions that reduce cognitive overhead during code reviews and improve team velocity.
Documentation Standards
Enforces comprehensive inline documentation and API documentation patterns that make codebases self-documenting and easier for new team members to understand.
Testing Strategy
The agent promotes a comprehensive testing strategy that balances coverage with maintainability. It understands the testing pyramid concept and applies appropriate testing patterns for different types of functionality, from unit tests for business logic to integration tests for complex workflows.
Unit Testing Patterns
Implements comprehensive unit testing strategies with proper mocking, dependency injection, and test isolation patterns that ensure reliable and fast test execution.
Integration Testing
Designs integration tests that validate critical user journeys and system interactions while maintaining reasonable execution times and debugging capabilities.
Performance Testing
Includes performance benchmarks and load testing patterns that help identify bottlenecks early in the development cycle and prevent performance regressions.
CI/CD Integration
The agent's patterns are designed to work seamlessly with modern CI/CD pipelines. From automated testing and code quality checks to deployment strategies, every aspect of the development workflow is optimized for automation and reliability.
- Automated build and test pipeline configurations that scale with project complexity
- Code quality gates that maintain standards without blocking productivity
- Deployment strategies that minimize downtime and enable rapid rollbacks
- Environment-specific configuration management that prevents deployment errors
- Monitoring and alerting setup that provides early warning of issues
Common Pitfalls and Solutions
Based on extensive analysis of real-world projects and common development challenges, this agent proactively addresses the most frequent pitfalls that teams encounter when working with modern frameworks. By understanding these challenges upfront, you can avoid costly refactoring later in the project lifecycle.
Architecture Anti-patterns
Identifies and prevents common architectural mistakes that can cripple application scalability and maintainability.
- Prevents monolithic component design by enforcing single responsibility principles
- Avoids circular dependencies through proper module organization
- Eliminates tight coupling by promoting dependency injection patterns
- Prevents over-engineering by applying appropriate abstraction levels
Performance Bottlenecks
Addresses the most common performance issues that emerge in production environments and provides preventive solutions.
- Prevents unnecessary re-renders through optimized state management
- Avoids memory leaks through proper cleanup patterns
- Optimizes bundle sizes through strategic code splitting
- Eliminates expensive operations in render cycles
Security Vulnerabilities
Proactively prevents the most common security vulnerabilities through secure coding patterns and best practices.
- Implements proper input sanitization to prevent injection attacks
- Enforces secure authentication and authorization patterns
- Prevents exposure of sensitive data through proper data handling
- Implements secure communication protocols and encryption
Migration and Legacy Support
Gradual Migration Strategies
When working with existing codebases, the agent provides strategies for gradual migration that minimize risk and maintain system stability throughout the transition process. These patterns allow teams to modernize legacy systems incrementally while continuing to deliver new features and maintain existing functionality.
Strangler Fig Pattern
Implements gradual replacement of legacy components without disrupting existing functionality, allowing for safe and systematic modernization of complex systems.
Feature Flag Integration
Uses feature flags to enable safe rollout of new implementations while maintaining the ability to quickly rollback if issues are discovered in production.
Backward Compatibility
Maintains compatibility with existing APIs and data formats during migration, ensuring that dependent systems continue to function without modification.
Framework Evolution
Technology frameworks evolve rapidly, and this agent is designed to help you stay current with the latest best practices while maintaining stability in your existing codebase. It provides guidance on when to adopt new features and how to integrate them safely without disrupting proven patterns.
- Evaluates new framework features for stability and production readiness
- Provides migration paths from deprecated patterns to modern alternatives
- Maintains compatibility with multiple framework versions during transitions
- Offers rollback strategies for feature adoption that doesn't meet expectations
Implementation Examples
Common Use Cases
This agent excels at handling complex architectural decisions, implementing design patterns correctly, and maintaining consistency across large codebases. It understands nuanced framework requirements and can guide you through challenging technical implementations.
Integration Tips
- Combine with project-specific context for maximum effectiveness
- Update the rules periodically as frameworks evolve
- Create variations for different project types or team preferences
- Use alongside linting and formatting tools for comprehensive code quality
Performance Optimization
The agent includes performance-focused directives that help generate optimized code from the start. It considers bundle sizes, rendering performance, memory management, and scalability patterns specific to the target framework. This proactive optimization reduces the need for later refactoring.
Advanced Configuration
Customization Guidelines
While these agent rules provide excellent defaults, you can customize them to match your specific needs. Consider adjusting the rules based on your project's unique requirements, team conventions, or architectural decisions. Keep the core principles intact while adapting specific implementations.
Combining Multiple Agents
Antigravity IDE allows you to layer multiple agent prompts for comprehensive coverage. Consider combining this agent with complementary ones like testing specialists, documentation generators, or security auditors. This creates a powerful development assistant tailored to your entire stack.
Version Control Integration
Store your customized agent rules in version control alongside your project. This ensures consistency across team members and preserves your optimizations. Use the .cursorrules file in your project root for automatic loading, or maintain a shared configuration repository for organization-wide standards.