This document provides global instructions and guidelines for AI agents working on projects within the hoverkraft-tech organization. All agents should follow these principles to ensure consistency, quality, and alignment with our organizational values.
Apply SOLID principles consistently across all code:
- Single Responsibility Principle: Each class/module should have one reason to change
- Open/Closed Principle: Open for extension, closed for modification
- Liskov Substitution Principle: Subtypes must be substitutable for their base types
- Interface Segregation Principle: Many specific interfaces are better than one general-purpose interface
- Dependency Inversion Principle: Depend on abstractions, not concretions
- Write self-documenting code with meaningful names
- Keep functions small and focused (ideally < 20 lines)
- Use consistent naming conventions appropriate to the language
- Avoid deep nesting (max 3 levels)
- Remove dead code and commented-out code
- Prefer composition over inheritance
- Use early returns to reduce complexity
- Extract common logic into reusable functions/modules
- Create shared utilities for repeated patterns
- Use configuration over duplication
- Leverage existing libraries instead of reimplementing functionality
- Build only what is required now
- Avoid speculative generality
- Don't add functionality for potential future needs
- Keep solutions simple and focused
- Prefer simple, straightforward solutions
- Avoid over-engineering
- Choose clarity over cleverness
- Minimize cognitive load for future developers
Documentation is critical for developer experience and should be treated with the same importance as code.
- User-facing documentation (README, API docs, guides)
- Code comments (only when necessary to explain "why", not "what")
- Architecture decision records (ADRs) for significant decisions
- Inline documentation for complex algorithms or business logic
- Avoid Duplication: Single source of truth for each piece of information
- Keep It Updated: Update docs in the same PR as code changes
- Be Concise: Write clearly and avoid unnecessary verbosity
- Include Examples: Provide practical, working examples
- Target the Audience: Write for developers who will use or maintain the code
Every project must have a comprehensive README.md with:
- Clear project description
- Prerequisites and dependencies
- Installation instructions
- Usage examples
- Configuration options
- Contributing guidelines
- License information
- Document public APIs thoroughly
- Explain complex business logic
- Document non-obvious design decisions
- Include examples for non-trivial usage
- Avoid stating the obvious (e.g.,
// increment iis noise)
When selecting dependencies, tools, or technologies, prioritize:
- Up-to-Date: Actively maintained with recent updates
- Widely Used: Strong community adoption and support
- Well Maintained: Regular releases, responsive maintainers, good issue management
- Performant: Proven performance characteristics
- Secure: Good security track record, timely security updates
- Compatible: Works well with our existing stack
- Documented: Quality documentation and examples
Prefer technologies that align with our core stack:
- Languages: TypeScript, Go, Python
- Infrastructure: Docker, Kubernetes, Terraform
- CI/CD: GitHub Actions, ArgoCD
- Monitoring: Prometheus, Grafana
- Keep dependencies up-to-date with automated tools (Dependabot, Renovate)
- Regularly audit for security vulnerabilities
- Minimize dependency count (fewer dependencies = less maintenance)
- Avoid dependencies with heavy transitive dependency trees
- Prefer stable, mature libraries over bleeding-edge alternatives
- Document why each major dependency was chosen
- Type Safety: Use strong typing (TypeScript over JavaScript, typed Python)
- Error Handling: Handle errors explicitly, don't silently fail
- Logging: Use structured logging with appropriate levels
- Testing: Write tests before or alongside code (TDD/BDD)
- Code Review: All code must be reviewed before merging
- Linting: Use and enforce linters/formatters (ESLint, Prettier, Black, golangci-lint)
- Unit Tests: Test individual components in isolation
- Integration Tests: Test component interactions
- E2E Tests: Test critical user flows (where applicable)
- Test Coverage: Aim for >80% coverage, but prioritize meaningful tests
- Test Quality: Tests should be readable, maintainable, and fast
- Mock External Dependencies: Isolate tests from external services
- Conventional Commits: MUST follow Conventional Commits specification
- Commit Messages: Use structured format:
<type>[optional scope]: <description> - Issue Titles: Use structured format:
<type>[optional scope]: <description> - Pull Request Titles: Use structured format:
<type>[optional scope]: <description> - Common types:
feat:,fix:,docs:,style:,refactor:,test:,chore: - Examples:
feat(auth): add OAuth2 login supportfix: resolve memory leak in cache handlerdocs: update API documentation for v2 endpoints
- Breaking changes: Use
BREAKING CHANGE:in footer or!after type/scope - This is mandatory for all commits, issue titles, and PR titles
- Commit Messages: Use structured format:
- Semantic Versioning: Follow Semantic Versioning 2.0.0 (SemVer)
- Version format:
MAJOR.MINOR.PATCH(e.g.,1.4.2) - MAJOR: Increment for incompatible API changes (breaking changes)
- MINOR: Increment for backwards-compatible new features
- PATCH: Increment for backwards-compatible bug fixes
- Pre-release versions: Use
-suffix (e.g.,1.0.0-alpha.1,2.0.0-rc.1) - Build metadata: Use
+suffix (e.g.,1.0.0+20230615)
- Version format:
- Branch Strategy: Feature branches from main, short-lived branches
- Pull Requests: Clear description, link to issues, include testing evidence
- Small Changes: Keep PRs focused and reviewable (< 400 lines ideal)
- Never commit secrets: Use environment variables or secret management
- Input Validation: Validate and sanitize all user inputs
- Least Privilege: Apply minimum necessary permissions
- Dependency Scanning: Regular security audits of dependencies
- HTTPS/TLS: Always use encrypted connections
- Security Headers: Implement appropriate security headers for web applications
- Optimize for Common Cases: Focus on hot paths
- Measure Before Optimizing: Use profiling tools
- Caching: Implement caching strategically
- Async Operations: Use asynchronous patterns for I/O operations
- Resource Management: Clean up resources properly (connections, files, etc.)
- Separate concerns into layers (presentation, business logic, data)
- Dependencies point inward (business logic doesn't depend on frameworks)
- Use dependency injection for flexibility and testability
- Define clear boundaries between modules/packages
- 12-Factor App: Follow 12-factor app methodology
- Stateless Services: Design stateless, horizontally scalable services
- Configuration: Externalize configuration
- Health Checks: Implement liveness and readiness probes
- Graceful Shutdown: Handle termination signals properly
- Observability: Expose metrics, logs, and traces
- RESTful Principles: Follow REST conventions for HTTP APIs
- Versioning: Version APIs from the start (v1, v2)
- Consistency: Maintain consistent naming and patterns
- Error Responses: Return meaningful, structured error messages
- Documentation: Use OpenAPI/Swagger for API documentation
- Rate Limiting: Implement rate limiting for public APIs
- Automated Testing: Run all tests on every commit
- Build Validation: Ensure code compiles/builds successfully
- Linting: Enforce code style and quality checks
- Security Scanning: Scan for vulnerabilities automatically
- Fast Feedback: Keep CI pipelines fast (< 10 minutes ideal)
- Automated Deployments: Deploy automatically after successful builds
- Environment Parity: Keep dev, staging, and prod as similar as possible
- Blue-Green/Canary: Use safe deployment strategies
- Rollback Plan: Always have a rollback strategy
- Infrastructure as Code: Manage infrastructure with Terraform
- Metrics: Expose application and business metrics
- Logging: Implement structured, searchable logging
- Tracing: Use distributed tracing for complex systems
- Alerts: Set up meaningful alerts for critical issues
- Dashboards: Create dashboards for system health visibility
- Understand Before Changing: Read and understand existing code first
- Minimal Changes: Make the smallest possible changes to achieve the goal
- Test Thoroughly: Ensure changes work and don't break existing functionality
- Follow Patterns: Match existing code style and patterns
- Update Documentation: Update docs when changing behavior
- Security Review: Check for security implications
- Check Existing Solutions: Look for existing functionality before creating new
- Design First: Think through the design before coding
- Start Small: Build incrementally with frequent testing
- Consider Edge Cases: Handle error conditions and edge cases
- Performance: Consider performance implications from the start
- Backward Compatibility: Maintain compatibility unless explicitly breaking
- Reproduce First: Understand and reproduce the bug
- Root Cause Analysis: Find the underlying cause, not just symptoms
- Add Tests: Add tests that would have caught the bug
- Fix Completely: Ensure the fix addresses all related issues
- Verify: Test the fix thoroughly in different scenarios
- Be Constructive: Provide helpful, specific feedback
- Check Against Standards: Verify adherence to these guidelines
- Test Coverage: Ensure adequate test coverage
- Security: Look for security vulnerabilities
- Performance: Consider performance implications
- Documentation: Verify documentation is updated
- Conventional Commits Format: ALWAYS use Conventional Commits format for titles
- Format:
<type>[optional scope]: <description> - Valid types:
feat,fix,docs,style,refactor,test,chore,perf,ci,build,revert - Example:
feat(api): add user profile endpointorfix: resolve memory leak in worker
- Format:
- Clear Description: Provide comprehensive context, motivation, and implementation details
- Link Related Items: Reference related issues, PRs, or documentation
- Include Testing Evidence: Show that changes have been tested appropriately
- Keep Scope Focused: One issue or PR should address one logical change
- Use TypeScript for all new projects
- Enable strict mode (
"strict": true) - Prefer functional patterns (immutability, pure functions)
- Use async/await over callbacks
- Use modern ES6+ features
- Format with Prettier, lint with ESLint
- Follow official Go style guide and
gofmt - Use
golangci-lintfor comprehensive linting - Handle errors explicitly (never ignore errors)
- Use context for cancellation and timeouts
- Keep interfaces small and focused
- Write table-driven tests
- Use Python 3.10+ for new projects
- Follow PEP 8 style guide
- Use type hints (PEP 484)
- Format with Black, lint with Ruff or Pylint
- Use virtual environments
- Prefer
pathliboveros.path - Use dataclasses or Pydantic for data structures
- Use modules for reusability
- Keep state in remote backend
- Use workspaces for environments
- Pin provider versions
- Use variables and outputs appropriately
- Document modules thoroughly
- Transparency: Work in the open, communicate decisions
- Community First: Consider community feedback and contributions
- Attribution: Give credit where due
- Licensing: Respect licenses, use MIT for our projects
- Conventional Commits Format: MUST use Conventional Commits format for issue and PR titles
- Format:
<type>[optional scope]: <description> - Example issue titles:
feat: add user authentication,fix(api): resolve timeout issue - Example PR titles:
docs: update installation guide,refactor(core): simplify error handling
- Format:
- Clear Descriptions: Write clear, detailed issue and PR descriptions
- Link Related Items: Reference related issues and PRs
- Timely Responses: Respond to feedback promptly
- Close Stale Items: Keep issue tracker clean and actionable
- Clean Code by Robert C. Martin
- The Pragmatic Programmer by Hunt and Thomas
- Designing Data-Intensive Applications by Martin Kleppmann
- Site Reliability Engineering (Google)
- Code Quality: SonarQube, CodeClimate
- Security: Snyk, Trivy, OWASP ZAP
- Performance: Lighthouse, k6, Apache Bench
- Documentation: Docusaurus, MkDocs
Before completing any task, verify:
- Code follows SOLID, Clean Code, DRY, YAGNI, and KISS principles
- Documentation is updated and comprehensive
- Tests are written and passing
- Security best practices are followed
- Dependencies are appropriate and up-to-date
- Code is linted and formatted
- Performance implications are considered
- Changes are minimal and focused
- Commit messages follow Conventional Commits format
- Issue titles follow Conventional Commits format (when creating/updating issues)
- Pull request titles follow Conventional Commits format (when creating/updating PRs)
- Version changes follow Semantic Versioning (when applicable)
- No secrets or sensitive data are committed
These guidelines ensure consistency and quality across all hoverkraft-tech projects. When in doubt, ask for clarification or refer to existing project examples.
Version: 1.0.0
Last Updated: 2025
Maintainer: Hoverkraft-Tech Organization