Best Practices
Get the most out of Antigravity Kit by following these proven practices and guidelines.Workflow Selection Guidelines
Choosing the right workflow command is crucial for optimal results. Here’s when to use each:Start with /brainstorm
Use /brainstorm When:
- Requirements are unclear or vague
- You need to explore multiple options
- The problem is complex and needs breaking down
- You’re not sure of the best approach
- Stakeholders have conflicting opinions
- What authentication methods do you need? (email/password, OAuth, magic links?)
- Do you need multi-factor authentication?
- What’s your session management strategy?
- What are your security requirements?
- Do you need role-based access control?
Use /create for Single-Domain Features
Use /create When:
- Adding features to existing projects
- Work is confined to one domain (frontend OR backend)
- Small-to-medium complexity
- Requirements are clear
- Creating a new React component
- Adding an API endpoint
- Building a database migration
- Adding a utility function
Use /orchestrate for Multi-Domain Tasks
Use /orchestrate When:
- Building full-stack features
- Work spans multiple domains (frontend + backend + database)
- Complex features with many moving parts
- Need multiple specialist perspectives
- Complete authentication systems (UI + API + database)
- E-commerce checkout flows
- Admin dashboards with CRUD operations
- Real-time chat features
- Payment integrations
- @frontend-specialist builds the UI components and pages
- @backend-specialist creates API endpoints and business logic
- @database-architect designs schema and migrations
- @test-engineer writes comprehensive tests
- @security-auditor reviews for vulnerabilities
- @performance-optimizer ensures optimal performance
The orchestrator maintains code coherence across all domains, ensuring consistent types, API contracts, and coding patterns.
Validation and Quality Gates
Antigravity Kit provides two validation scripts that catch issues before they reach production.Quick Validation: checklist.py
Use during development:
- ✅ Security scan (vulnerabilities, exposed secrets)
- ✅ Code quality (ESLint errors, TypeScript issues)
- ✅ Schema validation (database schema errors)
- ✅ Test suite (unit tests pass)
- ✅ UX audit (basic accessibility)
- ✅ SEO check (meta tags, performance)
- After making changes
- Before committing code
- During feature development
- When AI completes a task
Full Verification: verify_all.py
Use before deployment:
- ✅ Everything in
checklist.pyPLUS: - ✅ Lighthouse audit (Core Web Vitals, performance)
- ✅ Playwright E2E tests (full user flows)
- ✅ Bundle analysis (bundle size, tree-shaking)
- ✅ Mobile audit (responsive design, touch targets)
- ✅ i18n check (translations, localization)
- Before deploying to production
- Before creating a release
- After major changes
- Weekly as part of CI/CD
.gitignore Configuration
Proper .gitignore configuration is crucial for Antigravity Kit to work correctly with AI-powered editors like Cursor and Windsurf.
The Problem
⚠️ Common Issue
If
.agent/ is in .gitignore, AI editors may not index the workflows, causing slash commands to disappear from suggestions.Recommended Solution
DON’T add.agent/ to .gitignore
Instead, keep the .agent/ folder tracked by Git but exclude it locally:
- ✅ Keeps
.agent/indexed by AI editors (slash commands work) - ✅ Prevents local
.agent/changes from being tracked - ✅ Doesn’t affect other team members
- ✅ Allows the kit to be updated via
ag-kit update
Why This Matters
With.agent/ in .gitignore:
.agent/ tracked (recommended):
Getting Best Results from Agents
Be Specific with Context
Bad requests:Provide Error Messages
When debugging, always include:- Full error message
- Stack trace
- Steps to reproduce
- Expected vs actual behavior
Trust the Automatic Agent Selection
The system is designed to automatically choose the right agent. Trust it! Don’t do this:- Getting a second opinion
- Requesting a specific code review perspective
- The automatic selection was clearly wrong
Leverage Multi-Agent Orchestration
For complex features, let the orchestrator do its job: Avoid:Skill Loading Optimization
Agents automatically load skills based on context, but you can optimize this:Related Skills Pattern
Some skills automatically trigger related skills:frontend-design→ suggestsweb-design-guidelinesafter codingweb-design-guidelines→ suggestsfrontend-designbefore codingapi-patterns→ may triggerdatabase-designfor data models
You don’t need to manually load skills. The system handles this automatically based on your request.
Scripts Are Not Auto-Executed
Skills may include validation scripts, but they’re never run automatically:Task Complexity Guidelines
Simple Tasks (1-2 hours)
Use: Direct natural language or/create
Examples:
- Add a button component
- Create a utility function
- Fix a typo in API response
- Update styling on a page
Medium Tasks (2-8 hours)
Use:/create for single-domain or /orchestrate for multi-domain
Examples:
- Build a feature with multiple components
- Create CRUD endpoints for a resource
- Implement form validation
- Add user notifications
Complex Tasks (8+ hours)
Use:/brainstorm → /plan → /orchestrate
Examples:
- Complete authentication system
- E-commerce checkout flow
- Admin dashboard with analytics
- Real-time chat feature
Deployment Best Practices
Pre-Deployment Checklist
Before running/deploy, ensure:
Post-Deployment Validation
After deploying:- Test critical user flows - Login, signup, checkout, etc.
- Check error monitoring - Watch for new errors in production
- Monitor performance - Check Lighthouse scores for production URL
- Verify analytics - Ensure tracking is working
- Test on mobile devices - Real device testing, not just browser DevTools
Common Pitfalls to Avoid
❌ Skipping Brainstorming
Problem: Jumping straight to implementation without exploring options Solution: Always/brainstorm for complex features
❌ Using /create for Full-Stack Features
Problem: Frontend and backend don’t align, manual integration needed
Solution: Use /orchestrate for any work spanning multiple domains
❌ Ignoring Validation Scripts
Problem: Issues discovered in production that could have been caught locally Solution: Runchecklist.py frequently and verify_all.py before every deployment
❌ Vague Requests
Problem: AI makes assumptions that don’t match your needs Solution: Provide specific requirements, examples, and context❌ Not Reading Agent Responses
Problem: Missing important caveats or manual steps needed Solution: Read the full response, especially “Next Steps” sections❌ Overriding Agent Selection Without Reason
Problem: Using wrong specialist for the task Solution: Trust automatic agent selection unless you have a specific reason to overridePro Tips
Performance Optimization Tips
For Large Codebases
-
Use specific file paths in requests:
-
Break large tasks into smaller ones:
-
Use
/explorer-agentto understand codebase structure:
For Better AI Responses
-
Provide examples of what you want:
-
Mention your tech stack if ambiguous:
-
Specify your preferences:
Getting Help
Review Documentation
- Architecture:
.agent/ARCHITECTURE.md- System overview - Agent Flow:
.agent/AGENT_FLOW.md- How requests are processed - Agents:
.agent/agents/*.md- Individual agent capabilities - Skills:
.agent/skills/*/SKILL.md- Skill documentation - Workflows:
.agent/workflows/*.md- Slash command details
Debug Issues
Common Issues
Slash commands not appearing:- Check
.agent/is not in.gitignore - Restart your AI editor
- Run
ag-kit statusto verify installation
- Verify
.agent/agents/folder exists - Check agent
.mdfiles are not corrupted - Run
ag-kit init --forceto reinstall
- Ensure
.agent/skills/folder is intact - Check
SKILL.mdfiles exist for each skill - Verify skill names in agent frontmatter are correct
Next Steps
- Try the Web App Example for a complete workflow
- Review Slash Commands reference
- Learn about Using Agents in detail
- Explore the API Reference for advanced usage
