Skip to main content

Overview

Context in Codewolf refers to the additional information you provide about your codebase, team, and workflows that enables more accurate analysis, relevant recommendations, and personalized insights.

Why context matters

Providing context helps Codewolf:
  • Understand your specific use cases and requirements
  • Prioritize issues based on business impact
  • Tailor recommendations to your tech stack
  • Recognize patterns unique to your domain
  • Filter noise and focus on what matters

Types of context

Business context

Help Codewolf understand what your code does:
business_context:
  industry: fintech
  product_type: payment_processing
  compliance_requirements:
    - PCI-DSS
    - SOC2
    - GDPR

  critical_paths:
    - payment_processing
    - user_authentication
    - fraud_detection

Technical context

Define your technical environment:
technical_context:
  languages:
    - python
    - typescript
    - go

  frameworks:
    - django
    - react
    - fastapi

  databases:
    - postgresql
    - redis
    - mongodb

  infrastructure:
    - kubernetes
    - aws
    - terraform

Team context

Provide information about your team structure:
teams:
  - name: backend
    members:
      - [email protected]
      - [email protected]
    focus_areas:
      - api-server
      - background-jobs

  - name: frontend
    members:
      - [email protected]
      - [email protected]
    focus_areas:
      - web-app
      - mobile-app

Workflow context

Describe your development process:
workflow_context:
  branching_strategy: trunk-based

  environments:
    - development
    - staging
    - production

  deployment_frequency: multiple_per_day

  code_review_required: true

  testing_strategy:
    - unit_tests
    - integration_tests
    - e2e_tests

Adding context

Configuration file

The primary way to add context is through a codewolf.yaml file in your repository root:
1

Create configuration file

touch codewolf.yaml
2

Define your context

version: 1.0

context:
  business:
    domain: e-commerce
    critical_features:
      - checkout
      - payment
      - inventory

  technical:
    languages: [python, typescript]
    frameworks: [django, react]

  team:
    size: 10
    timezone: America/New_York
3

Commit and push

git add codewolf.yaml
git commit -m "Add Codewolf context configuration"
git push
Codewolf will automatically detect and apply the context.

Dashboard configuration

You can also add context through the Codewolf dashboard:
  1. Go to Settings > Context
  2. Fill in the context forms
  3. Save your changes
Configuration file settings take precedence over dashboard settings.

Code annotations

Add context directly in your code using comments:
# @codewolf: critical-path
# @codewolf: compliance=PCI-DSS
def process_payment(amount, card_number):
    """Process customer payment."""
    # Payment processing logic
    pass
// @codewolf: high-traffic
// @codewolf: performance-critical
async function handleCheckout(cartId: string) {
  // Checkout logic
}

Context usage

Issue prioritization

Context helps Codewolf prioritize issues: Without context:
  • All security issues treated equally
  • No business impact consideration
  • Generic recommendations
With context:
  • Critical paths get higher priority
  • Compliance requirements highlighted
  • Industry-specific recommendations

Custom rules

Define context-aware rules:
rules:
  - name: payment-validation
    applies_to:
      context: critical_paths
      value: payment_processing
    checks:
      - require_unit_tests
      - require_integration_tests
      - require_security_review

  - name: performance-monitoring
    applies_to:
      context: high_traffic
    checks:
      - require_performance_tests
      - monitor_latency
      - set_slo_targets

Smart notifications

Context enables intelligent alerting:
notifications:
  critical_path_changes:
    enabled: true
    channels:
      - slack
      - email
    recipients:
      - team: backend
      - role: tech-lead

  compliance_violations:
    enabled: true
    severity: critical
    channels:
      - pagerduty

Best practices

Provide enough context:
  • Define critical paths and features
  • Specify compliance requirements
  • Document team ownership
  • Describe workflow processes
Keep context updated:
  • Review context during sprint planning
  • Update when architecture changes
  • Sync with team changes
  • Validate context quarterly
Avoid over-specification:
  • Don’t document every detail
  • Focus on what affects analysis
  • Keep configuration maintainable
  • Use auto-discovery where possible

Example configurations

Startup SaaS

version: 1.0

context:
  business:
    domain: saas
    stage: early-stage
    users: 1000

  technical:
    languages: [typescript, python]
    frameworks: [nextjs, fastapi]
    infrastructure: [vercel, aws]

  team:
    size: 5
    timezone: America/Los_Angeles

  workflow:
    deployment_frequency: daily
    review_required: true

Enterprise fintech

version: 1.0

context:
  business:
    domain: fintech
    industry: payment_processing
    compliance:
      - PCI-DSS
      - SOC2
      - ISO27001
    critical_paths:
      - payment_processing
      - fraud_detection
      - kyc_verification

  technical:
    languages: [java, kotlin, go]
    frameworks: [spring, ktor]
    databases: [postgresql, cassandra]
    infrastructure: [kubernetes, aws]

  team:
    size: 50
    timezone: UTC

  workflow:
    branching_strategy: gitflow
    deployment_frequency: weekly
    security_review: required

Troubleshooting

  • Verify codewolf.yaml syntax is valid
  • Check file is in repository root
  • Ensure context version is supported
  • Review Codewolf dashboard for errors
Priority order:
  1. Code annotations
  2. Configuration file
  3. Dashboard settings
  4. Auto-detected context
  • Context changes may take 5-10 minutes to apply
  • Trigger a new analysis to see updates
  • Check that context keys match documentation