Custom Context Profiles
Custom Context Profiles
Kit supports organization-specific coding standards and review guidelines through custom context profiles. Create profiles that automatically inject your company’s coding standards, security requirements, and style guidelines into every PR review, ensuring consistent and organization-aligned feedback.
Quick Start
# Create a profile from your existing coding guidelineskit review-profile create --name company-standards \ --file coding-guidelines.md \ --description "Acme Corp coding standards"
# Use in any reviewkit review --profile company-standards https://github.com/owner/repo/pull/123
# List all profileskit review-profile list
Profile Management
Creating Profiles
From a file (recommended for sharing):
kit review-profile create \ --name python-security \ --file security-guidelines.md \ --description "Python security best practices" \ --tags "security,python"
Interactive creation:
kit review-profile create \ --name company-standards \ --description "Company coding standards"# Then type your guidelines, press Enter for new lines, then Ctrl+D to finish
Managing Profiles
# List all profiles with detailskit review-profile list --format table
# Show specific profile contentkit review-profile show --name company-standards
# Edit existing profilekit review-profile edit --name company-standards \ --file updated-guidelines.md
# Share profiles between team memberskit review-profile export --name company-standards \ --file shared-standards.mdkit review-profile import --file shared-standards.md \ --name imported-standards
# Clean up old profileskit review-profile delete --name old-profile
Example Profile Content
Here’s an effective profile structure that provides concrete, actionable guidance:
Security-Focused Profile
**Security Review Guidelines:**
- **Input Validation**: All user inputs must be validated against expected formats- **SQL Injection Prevention**: Use parameterized queries, never string concatenation- **XSS Prevention**: Sanitize all user content before rendering- **Authentication**: Verify all endpoints require proper authentication- **Authorization**: Check that users can only access resources they own- **Secrets Management**: No hardcoded API keys, tokens, or passwords- **Logging**: Sensitive data must not appear in logs- **Dependencies**: Flag any new dependencies for security review
Code Quality Profile
**Code Quality Standards:**
- **Documentation**: All public functions must have docstrings with examples- **Type Safety**: Use type hints for all function parameters and returns- **Error Handling**: Implement proper exception handling with specific error types- **Testing**: New features require unit tests with 80%+ coverage- **Performance**: Flag N+1 queries and inefficient algorithms- **Architecture**: Follow SOLID principles, maintain loose coupling
Using Profiles in Reviews
Basic Usage
# Apply organization standards automaticallykit review --profile company-standards https://github.com/owner/repo/pull/123
# Combine with other optionskit review --profile security-focused \ --priority=high \ --model claude-sonnet-4 \ https://github.com/owner/repo/pull/123
# Multiple contexts for different teamskit review --profile backend-api https://github.com/owner/repo/pull/123 # API teamkit review --profile frontend-react https://github.com/owner/repo/pull/123 # UI team
CI/CD Integration
- name: AI Review with Company Standards run: | pip install cased-kit kit review --profile company-standards ${{ github.event.pull_request.html_url }} env: KIT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} KIT_ANTHROPIC_TOKEN: ${{ secrets.ANTHROPIC_API_KEY }}
Team Organization
Team-Specific Profiles
# Different standards for different teamskit review-profile create --name backend-api \ --description "Backend API development standards" \ --tags "backend,api,python"
kit review-profile create --name frontend-react \ --description "React frontend standards" \ --tags "frontend,react,typescript"
kit review-profile create --name security-hardening \ --description "Security review guidelines" \ --tags "security,compliance"
Project-Type Profiles
# Different standards for different project typeskit review-profile create --name microservice-standards \ --description "Microservice architecture guidelines"
kit review-profile create --name data-pipeline-standards \ --description "Data processing best practices"
kit review-profile create --name mobile-app-standards \ --description "Mobile development guidelines"
Advanced Examples
Multi-Modal Team Setup
# In your CI/CD, use different profiles based on changed files- name: Smart Profile Selection run: | pip install cased-kit
# Check what type of files changed CHANGED_FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq -r '.files[].filename')
if echo "$CHANGED_FILES" | grep -q "\.py$"; then PROFILE="python-backend" elif echo "$CHANGED_FILES" | grep -q "\.(ts|tsx|js|jsx)$"; then PROFILE="frontend-react" elif echo "$CHANGED_FILES" | grep -q "security\|auth"; then PROFILE="security-focused" else PROFILE="general-standards" fi
kit review --profile "$PROFILE" ${{ github.event.pull_request.html_url }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} KIT_ANTHROPIC_TOKEN: ${{ secrets.ANTHROPIC_API_KEY }}
Profile Best Practices
Writing Effective Profiles
- Be Specific: Include concrete examples, not just general principles
- Focus on Intent: Explain why certain practices are required
- Use Examples: Show good and bad code patterns when possible
- Stay Current: Regular review and update profiles as standards evolve
- Tag Appropriately: Use tags for easy organization and discovery
Team Workflow
- Start Small: Begin with essential standards, expand over time
- Collaborate: Involve team members in creating and updating profiles
- Version Control: Export profiles and track them alongside your code
- Regular Reviews: Schedule quarterly profile review meetings
- Share Success: Use export/import to share effective profiles across teams
Example Integration
# Morning routine: Update and sync team profileskit review-profile export --name company-standards --file standards.mdgit add standards.md && git commit -m "Update coding standards"
# Review with latest standardskit review --profile company-standards https://github.com/owner/repo/pull/123
Storage and Sharing
- Location: Profiles stored in
~/.kit/profiles/
as human-readable YAML files - Format: Includes metadata (name, description, tags, timestamps) and content
- Sharing: Export/import functionality for team collaboration and version control
- Backup: Include profile exports in your team’s configuration management