### Run Initial Setup Source: https://github.com/srtab/daiv/blob/main/README.md Execute the make setup command to create necessary configuration files from templates. ```bash make setup ``` -------------------------------- ### Install Dependencies Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/init/examples/agents-md-sample.md Installs all project dependencies, including extras. ```bash # Install uv sync --all-extras ``` -------------------------------- ### Full Repository Configuration Example Source: https://github.com/srtab/daiv/blob/main/docs/customization/repository-config.md This snippet shows a comprehensive example of a .daiv.yml file, illustrating various configuration options for DAIV. ```yaml # Repository settings default_branch: main context_file_name: "AGENTS.md" suggest_context_file: true # Access control allowed_usernames: - alice - bob # Files the agent can see but won't read omit_content_patterns: - "*.min.js" - "*.svg" - "*.lock" # Feature toggles issue_addressing: enabled: true pull_request_assistant: enabled: true slash_commands: enabled: true # Model overrides models: agent: model: "openrouter:anthropic/claude-sonnet-4.6" fallback_model: "openrouter:openai/gpt-5.3-codex" thinking_level: "medium" diff_to_metadata: model: "openrouter:anthropic/claude-sonnet-4.6" fallback_model: "openrouter:openai/gpt-5.3-codex" ``` -------------------------------- ### Install Authentication Dependencies Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/plan/examples/complex-plan.md Install jsonwebtoken for JWT creation and bcryptjs for password hashing. Add these to your project's dependencies. ```bash npm install jsonwebtoken bcryptjs ``` -------------------------------- ### Start Local GitLab Instance Source: https://github.com/srtab/daiv/blob/main/README.md Start the local GitLab instance using Docker Compose with the 'gitlab' profile. ```bash docker compose --profile gitlab up ``` -------------------------------- ### Start Optional Services with Docker Compose Profiles Source: https://github.com/srtab/daiv/blob/main/README.md Start optional services like GitLab, sandbox executor, MCP servers, or all services using Docker Compose profiles. Profiles can be combined. ```bash docker compose --profile gitlab up # local GitLab instance + runner docker compose --profile sandbox up # sandbox code executor docker compose --profile mcp up # MCP servers docker compose --profile full up # all services ``` ```bash docker compose --profile gitlab --profile sandbox up ``` -------------------------------- ### Changelog Skill Example Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Provides a complete example of a changelog skill, including its metadata, instructions for updating the CHANGELOG.md, and format guidelines. ```markdown --- name: changelog description: > Update the CHANGELOG.md file when changes are made. Use when the user asks to "update the changelog", "add a changelog entry", or after completing a feature implementation. --- # Changelog Maintenance ## Instructions 1. Read `CHANGELOG.md` from the repository root 2. Determine the change type: Added, Changed, Fixed, Removed 3. Add an entry under the `[Unreleased]` section 4. Follow the existing format and style in the file 5. Keep entries concise — one line per change ## Format Use [Keep a Changelog](https://keepachangelog.com/) format: ```markdown ## [Unreleased] ### Added - New feature description ``` ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/srtab/daiv/blob/main/README.md Install project dependencies into a virtual environment using uv. This is optional and useful for linting or IDE autocompletion. ```bash uv sync ``` -------------------------------- ### Setup DAIV Development Environment Source: https://github.com/srtab/daiv/blob/main/CONTRIBUTING.md Clone the repository and set up the core services using Docker Compose. Optional services can be enabled via profiles. ```bash git clone https://github.com/srtab/daiv.git && cd daiv make setup # creates config files from templates docker compose up --build # starts core services (db, redis, app, worker, scheduler) ``` -------------------------------- ### Start Core Services Source: https://github.com/srtab/daiv/blob/main/README.md Build and start the core DAIV services including database, Redis, app, worker, and scheduler using Docker Compose. SSL certificates are auto-generated on the first run. ```bash docker compose up --build ``` -------------------------------- ### Good vs. Bad Skill Description Examples Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Illustrates effective and ineffective ways to write the 'description' field in SKILL.md. The good example includes specific trigger phrases for agent matching, while the bad example is too vague. ```yaml # Good — includes trigger phrases the agent can match description: > Diagnose and fix CI/CD pipeline failures. Use when the user mentions "pipeline is failing", "CI broken", "fix the build", or "debug the tests". # Bad — too vague for the agent to match description: Helps with CI/CD issues. ``` -------------------------------- ### Example Inline Finding Marker (Question) Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/references/gitlab-delivery.md An example of a generated marker line for the 'question' archetype, used for inline findings. ```html ``` -------------------------------- ### Agent Skill Instructions Example Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Defines clear, actionable steps for an agent to follow, such as fetching diffs and checking for specific code issues. ```markdown ## Instructions 1. Fetch the merge request diff using the platform tools 2. For each changed file, check for: - Missing error handling - Unvalidated inputs - Hardcoded credentials 3. Report findings grouped by severity (High / Medium / Low) ``` -------------------------------- ### Start DAIV Services with Docker Compose Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md Run this command from the directory containing your docker-compose.yml to start all DAIV services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### RT Log Entry Example Source: https://github.com/srtab/daiv/blob/main/docs/integrations/rt/index.md This is an example of the log line you should see in rt.log when DAIV successfully submits a job for a ticket. ```log daiv-triage: submitted job (batch ) for ticket (queue=... repo=...) ``` -------------------------------- ### Custom Skills Directory Structure Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Example directory structure for custom global skills. Each skill requires a SKILL.md file and can include associated scripts. ```directory custom-skills/ ├── my-workflow/ │ ├── SKILL.md │ └── scripts/ │ └── helper.py └── team-review/ └── SKILL.md ``` -------------------------------- ### Markdown Structure for PDF Processing Skill Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/skill-creator/SKILL.md Organizes PDF processing skill content with a quick start guide and references to advanced features like form filling, API, and examples. DAIV loads referenced files only when needed. ```markdown # PDF Processing ## Quick start Extract text with pdfplumber: [code example] ## Advanced features - **Form filling**: See [FORMS.md](FORMS.md) for complete guide - **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods - **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns ``` -------------------------------- ### Custom Subagent Configuration Example Source: https://github.com/srtab/daiv/blob/main/docs/features/subagents.md Defines a custom subagent named 'database-migration' with a specific model and system prompt for planning and reviewing database migrations. ```yaml --- name: database-migration description: Specialized agent for planning and reviewing database migrations. Use when the task involves schema changes, data migrations, or ORM model modifications. model: openrouter:anthropic/claude-sonnet-4.6 # optional --- You are a database migration specialist. When given a task: 1. Review the current schema by reading model files 2. Identify all affected tables and relationships 3. Plan the migration steps in order 4. Check for data loss risks 5. Suggest rollback strategies ``` -------------------------------- ### Example Inline Finding Marker (Remove Dead Lines) Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/references/gitlab-delivery.md An example of a generated marker line for the 'remove_dead_lines' archetype, used for inline findings. ```html ``` -------------------------------- ### Setup LangSmith Dashboard Source: https://github.com/srtab/daiv/blob/main/docs/reference/monitoring.md Use this command to create a pre-configured LangSmith custom dashboard for DAIV. It sets up charts for key metrics. ```bash python manage.py setup_langsmith_dashboard --project ``` -------------------------------- ### Docker Swarm Secrets for GitHub Integration Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/platform-setup.md Create Docker secrets for GitHub integration in a Docker Swarm setup, including App ID, Installation ID, and Webhook Secret. ```bash # Create secrets for GitHub integration echo "123456" | docker secret create codebase_github_app_id - echo "789012" | docker secret create codebase_github_installation_id - docker secret create codebase_github_private_key /path/to/your-private-key.pem echo "your-webhook-secret-here" | docker secret create codebase_github_webhook_secret - ``` -------------------------------- ### OpenAI Model Format Example Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/llm-providers.md Use OpenAI model names directly without any prefix when configuring DAIV. Ensure the model name corresponds to an available model on the OpenAI platform. ```text gpt-5.3-codex o4-mini ``` -------------------------------- ### Restart Nginx Service Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md Apply the Nginx configuration changes by restarting the Nginx service. Verify the setup by accessing your domain in a web browser. ```bash systemctl restart nginx ``` -------------------------------- ### Docker Swarm Stack Configuration Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md This YAML file defines the services, networks, and volumes for deploying DAIV. Customize environment variables and annotations as per your setup. ```yaml x-app-environment-defaults: &app_environment_defaults # DJANGO DJANGO_SETTINGS_MODULE: daiv.settings.production DJANGO_ALLOWED_HOSTS: your-hostname.com,app,127.0.0.1 (1) DJANGO_REDIS_URL: redis://daiv_redis:6379/0 DJANGO_REDIS_SESSION_URL: redis://daiv_redis:6379/1 DJANGO_REDIS_CHECKPOINT_URL: redis://daiv_redis:6379/2 DAIV_EXTERNAL_URL: https://your-hostname.com (2) # DATABASE DB_NAME: daiv DB_USER: daiv_admin DB_HOST: daiv_db DB_SSLMODE: prefer # CODEBASE CODEBASE_CLIENT: gitlab CODEBASE_GITLAB_URL: https://gitlab.com (3) # EMAIL EMAIL_HOST: smtp.example.com EMAIL_PORT: 587 EMAIL_USE_TLS: true # SANDBOX DAIV_SANDBOX_URL: http://sandbox:8000 (4) # MCP (built-in supergateway containers) MCP_SENTRY_URL: http://mcp-sentry:8000/mcp (17) MCP_CONTEXT7_URL: http://mcp-context7:8000/mcp (17) x-deploy-defaults: &deploy_defaults replicas: 1 update_config: order: start-first delay: 60s failure_action: rollback rollback_config: parallelism: 0 restart_policy: condition: any window: 120s ``` -------------------------------- ### First Monday of Month Cron Expression Example Source: https://github.com/srtab/daiv/blob/main/docs/features/scheduled-jobs.md Example of a custom cron expression for running a job on the first Monday of the month at 9 AM. Accepts any valid five-field cron expression. ```cron 0 9 1-7 * 1 ``` -------------------------------- ### OpenRouter Model Format Example Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/llm-providers.md When using OpenRouter, prefix the model name with 'openrouter:'. This allows DAIV to correctly identify and select models available through OpenRouter, such as those from Anthropic or OpenAI. ```text openrouter:anthropic/claude-sonnet-4.6 openrouter:openai/gpt-5.3-codex ``` -------------------------------- ### Create a New Custom Skill Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md Use the /skill-creator skill to be guided through the process of creating a new custom skill for DAIV. ```text @daiv /skill-creator ``` -------------------------------- ### Custom Interval Cron Expression Example Source: https://github.com/srtab/daiv/blob/main/docs/features/scheduled-jobs.md Example of a custom cron expression for running a job every 6 hours. Accepts any valid five-field cron expression. ```cron 0 */6 * * * ``` -------------------------------- ### Alpine.js Repo Search Combobox Source: https://github.com/srtab/daiv/blob/main/DESIGN.md An example of a reusable Alpine.js component for asynchronous repository search. It features debounced search, an abort controller, and a loading state. ```html
``` -------------------------------- ### Submit a Job Response Source: https://github.com/srtab/daiv/blob/main/docs/features/jobs-api.md This is an example of a successful response when submitting a job. It includes a batch ID and details for each job created within the batch, including job ID, repository, and initial status. ```json { "batch_id": "5b9e8a3c-9b7e-4c0d-a1f5-7e2c8d4b1a90", "jobs": [ { "job_id": "1adfbf7a-917e-4f2e-8f54-17a27c006ec5", "repo_id": "mygroup/myproject", "ref": null, "thread_id": "9c1e8a3c-9b7e-4c0d-a1f5-7e2c8d4b1a90", "status": "READY" } ], "failed": [] } ``` -------------------------------- ### Tool Filtering Configuration Source: https://github.com/srtab/daiv/blob/main/docs/customization/mcp-tools.md Configure tool filtering for an MCP server to either allow only specific tools or block specific tools. This example shows an 'allow' mode. ```json { "toolFilter": { "mode": "allow", "list": ["tool_a", "tool_b"] } } ``` -------------------------------- ### Anthropic Model Format Example Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/llm-providers.md Use Anthropic model names directly without any prefix. Be aware that Anthropic's API can be unstable and may have strict rate limits. ```text claude-sonnet-4.6 claude-opus-4.6 ``` -------------------------------- ### Summary Discussion Body Example Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/examples/example-review-output.md A summary of code review findings, collecting discussion-only items and an index of inline findings. This body is updated in place for re-reviews. ```markdown ## Findings ### Medium **1. Validation belongs in the model layer, not the controller** — `controllers/seller.ts:55`
Details `createSeller` validates email uniqueness before delegating to the model. The model already exposes a `validate()` method which is the conventional place for this check, and putting it here means callers from the background-job path won't enforce it. Move the uniqueness check into the model's `validate()`.
**2. Same retry policy declared in three ingestion modules** — `ingest/wavecom.py:21`
Details `RetryPolicy(maxRetries=3, backoff=2)` appears verbatim in three sibling modules. Extract to a shared constant so any future tweak is one edit, not three.
**3. N+1: seller lookup runs once per order row** — `api/orders.py:90`
Details `serialize_order` calls `Seller.objects.get(...)` inside the per-order loop, so a page of N orders issues N+1 queries. The fix spans the serializer and the queryset — add `select_related("seller")` on the orders queryset in the viewset — so it can't anchor on a single diff line.
## Questions **4. Does the new ingestion pipeline preserve ordering across the three modules, or is reordering OK?** — multiple files
Details The refactor moves dedup into `ingest/wavecom.py` and removes the explicit sort step from two callers. The change spans more than one file, so it can't anchor on a single diff line. Is the looser ordering intentional, or did the dedup move accidentally drop the sort?
## Inline findings posted (3) - `services/api.py:42` — drop explicit default `timeout=30` *(remove_dead_lines)* - `internal/cache/key.go:18` — use `strings.Join` instead of manual loop *(use_framework_idiom)* - `env_files/all/grafana.env:9` — is `alloy` intentionally omitted from the default tenant list? *(question)* _5/5 detectors · 9 candidates · 2 merged → 3 inline, 4 in summary (rest refuted)._ ``` -------------------------------- ### Good Description for Subagent Trigger Phrases Source: https://github.com/srtab/daiv/blob/main/docs/features/subagents.md Illustrates a specific and effective 'description' field for a custom subagent, using trigger phrases to guide the main agent's delegation decisions. ```yaml # Good — specific triggers the agent can match description: > Specialized agent for API endpoint design and implementation. Use when the task involves creating new REST endpoints, modifying API responses, or designing request/response schemas. ``` -------------------------------- ### Bad Description for Subagent Trigger Phrases Source: https://github.com/srtab/daiv/blob/main/docs/features/subagents.md Provides an example of a vague 'description' field for a custom subagent, highlighting why it's ineffective for the main agent's delegation logic. ```yaml # Bad — too vague description: Helps with API stuff. ``` -------------------------------- ### Initialize a New Skill Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/skill-creator/SKILL.md Use this script to create a new skill template. Specify the skill name and the output directory for the new skill. ```bash scripts/init_skill.py --path ``` ```bash scripts/init_skill.py --path ~/.agents/skills ``` -------------------------------- ### Initialize or Update AGENTS.md Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md The /init skill analyzes the repository and generates or updates the AGENTS.md guidance file. ```text @daiv /init ``` -------------------------------- ### Display All Commands and Skills Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md Use the /help command to list all available slash commands and skills in the current context. ```text @daiv /help ``` -------------------------------- ### Use Framework Idiom Suggestion Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/examples/example-review-output.md Recommends using the standard library's `strings.Join` function instead of a manual concatenation loop for better readability in Go. ```go return strings.Join(parts, ":") ``` -------------------------------- ### Run Full Test Suite Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/init/examples/agents-md-sample.md Executes the entire test suite for the project. ```bash # Test (full suite) pytest ``` -------------------------------- ### Bundling Supporting Files in Agent Skills Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Illustrates how to structure a skill directory to include helper scripts and templates, referenced using relative paths. ```treeview my-skill/ ├── SKILL.md ├── scripts/ │ └── validate.py └── templates/ └── report.md ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/srtab/daiv/blob/main/README.md Execute the comprehensive test suite with coverage by entering the app container and running the make test command. ```bash $ docker compose exec -it app bash $ make test ``` -------------------------------- ### Custom Review Rule Example: No Logging Source: https://github.com/srtab/daiv/blob/main/docs/features/pull-request-assistant.md Define a custom review rule prohibiting the logging of request or response bodies. ```markdown - *Never log request or response bodies.* ``` -------------------------------- ### Bootstrap First Admin User Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/accounts.md Use this command to create the initial administrator account when OAuth is not yet configured. It ensures an admin exists for headless deployments. This command will not run if an admin or a user with the specified email already exists. ```bash docker exec -it daiv-app python manage.py bootstrap_admin admin@example.com ``` -------------------------------- ### Generate Implementation Plan Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md Use the /plan skill to have DAIV explore the codebase and produce a detailed implementation plan for a given task. ```text @daiv /plan implement rate limiting for the API ``` -------------------------------- ### Custom Review Rule Example: Idempotent Tasks Source: https://github.com/srtab/daiv/blob/main/docs/features/pull-request-assistant.md Define a custom review rule requiring all new Celery tasks to be idempotent. ```markdown - *New Celery tasks must be idempotent.* ``` -------------------------------- ### Set Up Webhooks for GitLab Integration Source: https://github.com/srtab/daiv/blob/main/README.md Configure webhooks for GitLab integration by running the django-admin setup_webhooks command. Ensure outbound network requests are allowed if encountering 'Invalid url given' errors. ```bash docker compose exec -it app django-admin setup_webhooks ``` -------------------------------- ### Ask Question: Import Placement Source: https://github.com/srtab/daiv/blob/main/docs/features/pull-request-assistant.md Query DAIV about the reasoning behind placing an import statement inside a method instead of at the top of the file. ```text @daiv why is this import inside the method instead of at the top? ``` -------------------------------- ### Django Page Template Example Source: https://github.com/srtab/daiv/blob/main/DESIGN.md This is a standard Django template that extends the base template and defines the title and main content blocks for a page. ```django {% extends "base.html" %} {% load static icon_tags %} {% block title %}Page Title — DAIV{% endblock %} {% block content %} {% include "accounts/_header.html" %}
{% endblock %} ``` -------------------------------- ### Create API Key Source: https://github.com/srtab/daiv/blob/main/docs/features/jobs-api.md Use the management command to create a new API key for a user. The key is outputted in 'prefix.secret' format and should be stored securely. ```bash python manage.py create_api_key --name "my-key" ``` -------------------------------- ### Simple Plan Format Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/plan/SKILL.md Use this markdown format for straightforward code changes. It requires a brief title, a description of what's changing, a list of modified files, and any relevant notes. ```markdown # [Brief Title] ## What's Changing [1–2 sentence description] ## Changes - `path/to/file.js` (line ~45) — [what changes] - `path/to/test.js` — [add test for...] ## Notes - [Key consideration or edge case] ``` -------------------------------- ### Retrieve GitLab Root Password Source: https://github.com/srtab/daiv/blob/main/README.md Get the initial root password for the local GitLab instance by executing a command within the GitLab container. ```bash docker compose exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password ``` -------------------------------- ### Markdown Template for Complex Implementation Plan Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/plan/references/complex-plan-template.md This markdown template provides a structured format for detailing complex implementation plans. It includes sections for project overview, current state, proposed solution, phased implementation, dependencies, testing, edge cases, risks, and open questions. ```markdown # Implementation Plan: [Feature/Refactor Name] ## 1. Overview [High-level description of the change, its purpose, and success criteria. 2–4 sentences.] ## 2. Current State Analysis [What exists today. Relevant patterns, architectural decisions, and dependencies discovered during exploration. Note anything that constrains the design.] ## 3. Proposed Solution [Architecture overview. Key design decisions and why they were made. Diagrams or ASCII art if helpful. Alternatives considered and why they were rejected.] ## 4. Implementation Phases ### Phase 1: [Foundation/Setup] 1. **[Action]** — [Purpose] - `path/to/file1.js` — Create — [what to add] - `path/to/file2.js` (line ~N) — [what changes] 2. **[Action]** — [Purpose] - `path/to/file3.js` — [what changes] ### Phase 2: [Core Implementation] 1. **[Action]** — [Purpose] - `path/to/file4.js` — Create — [what to add] 2. **[Action]** — [Purpose] - `path/to/file5.js` (line ~N) — [what changes] ### Phase 3: [Integration and Testing] 1. **[Action]** — [Purpose] - `path/to/file6.test.js` — Create — [what to test] ## 5. Dependencies and Configuration [New packages to install. Config file changes. Environment variables to add. Infrastructure requirements.] ## 6. Testing Strategy [Unit tests — what to cover and where. Integration tests — key flows to verify. Manual testing steps.] ## 7. Edge Cases and Error Handling [Specific scenarios that need explicit handling. Validation requirements. Error messages and states. Failure modes and recovery behavior.] ## 8. Risks and Mitigations | Risk | Likelihood | Impact | Mitigation | |------|-----------|--------|------------| | [Risk 1] | High/Med/Low | High/Med/Low | [How to address] | | [Risk 2] | High/Med/Low | High/Med/Low | [How to address] | ## 9. Open Questions [Decisions that need clarification before or during implementation. Flag ambiguities discovered during exploration.] ``` -------------------------------- ### Reset Conversation Context Source: https://github.com/srtab/daiv/blob/main/docs/features/pull-request-assistant.md Use this command to clear DAIV's current conversation context and start a fresh interaction within a pull request. ```text @daiv /clear ``` -------------------------------- ### Directory Structure for Multi-Variant Skills Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/skill-creator/SKILL.md Organizes a cloud deployment skill by variant (AWS, GCP, Azure) to load specific deployment patterns based on the user's chosen provider. ```directory structure cloud-deploy/ ├── SKILL.md (workflow + provider selection) └── references/ ├── aws.md (AWS deployment patterns) ├── gcp.md (GCP deployment patterns) └── azure.md (Azure deployment patterns) ``` -------------------------------- ### Run All Tests Source: https://github.com/srtab/daiv/blob/main/CONTRIBUTING.md Execute the 'test' make target to run the entire test suite. This is crucial for ensuring code stability and correctness. ```bash make test ``` -------------------------------- ### Get Docker Group ID Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md This command retrieves the group ID for the Docker socket, which may be needed for adding the docker group to the sandbox container. ```bash stat -c '%g' /var/run/docker.sock ``` -------------------------------- ### List Available Subagents Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md Use the /agents command to see a list of available subagents and their descriptions. ```text @daiv /agents ``` -------------------------------- ### Run Integration Tests Source: https://github.com/srtab/daiv/blob/main/AGENTS.md Executes integration tests, which require a database. Uses the -m diff_to_metadata marker. ```bash make integration-tests # runs with -m diff_to_metadata marker ``` -------------------------------- ### Display Elapsed Time in Jinja Template Source: https://github.com/srtab/daiv/blob/main/daiv/activity/templates/activity/_hero_running.html Conditionally displays the elapsed time if the activity has started. Uses a Jinja conditional and an x-text directive for dynamic updates. ```html {% if activity.started_at %} this.elapsed++, 1000); }, destroy() { if (this.tickId) clearInterval(this.tickId); } }" x-text="'⏱ ' + fmt(elapsed) + ' elapsed'">⏱ elapsed {% endif %} ``` -------------------------------- ### Run All Unit Tests with Coverage Source: https://github.com/srtab/daiv/blob/main/AGENTS.md Executes all unit tests and generates a coverage report. Sets LANGCHAIN_TRACING_V2 to false. ```bash make test # all unit tests with coverage (sets LANGCHAIN_TRACING_V2=false) ``` -------------------------------- ### Docker Compose Environment Variables for GitHub Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/platform-setup.md Configure environment variables in docker-compose.yml for GitHub App integration. This includes App ID, Installation ID, and Webhook Secret. ```yaml x-app-defaults: &x_app_default # ... environment: CODEBASE_CLIENT: github CODEBASE_GITHUB_APP_ID: 123456 # Your GitHub App ID CODEBASE_GITHUB_INSTALLATION_ID: 789012 # Your Installation ID CODEBASE_GITHUB_WEBHOOK_SECRET: your-webhook-secret-here # The secret you generated # For GitHub Enterprise, also set: # CODEBASE_GITHUB_URL: https://github.your-company.com # ... ``` -------------------------------- ### Run Linting and Formatting Checks Source: https://github.com/srtab/daiv/blob/main/CONTRIBUTING.md Execute the 'lint' make target to check code style and formatting. This command ensures adherence to project standards before submitting changes. ```bash make lint ``` -------------------------------- ### Add DAIV MCP Server with Claude Code Source: https://github.com/srtab/daiv/blob/main/docs/features/mcp-endpoint.md Use this command to add the DAIV MCP server endpoint for use with Claude Code. Ensure you have Claude Code installed. ```bash claude mcp add daiv --transport http https://daiv.example.com/mcp/ ``` -------------------------------- ### Run Linting and Formatting Checks Source: https://github.com/srtab/daiv/blob/main/README.md Check for linting and formatting issues within the app container using make lint, or automatically fix them with make lint-fix. ```bash $ docker compose exec -it app bash $ make lint # to check for linting and formatting issues $ make lint-fix # to automatically fix linting and formatting issues ``` -------------------------------- ### Docker Secrets for Private Key (Recommended) Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/platform-setup.md Create a Docker secret from your downloaded private key (.pem file) for secure handling. ```bash # Create secret from the downloaded .pem file docker secret create codebase_github_private_key /path/to/your-private-key.pem ``` -------------------------------- ### Configuration Question for Env File Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/examples/example-review-output.md Asks a question about an environment file configuration, specifically whether 'alloy' should be included in the default setting based on migration notes. ```env The migration notes call for `fake|alloy` during cutover, but this default is `fake` only. Is `alloy` intentionally omitted here (environment-specific override), or should the default match the documented cutover list? ``` -------------------------------- ### Google Gemini Model Names Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/llm-providers.md Use the model names directly as provided by Google Gemini. Examples include preview versions of Gemini 2.5 Pro and Gemini 2.4 Flash. ```text gemini-2.5-pro-preview-05-06 gemini-2.4-flash-preview-04-17 ``` -------------------------------- ### Validate Skill with Quick Validation Script Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/skill-creator/SKILL.md Run this script to validate the format and requirements of your skill. It checks frontmatter, naming conventions, and description completeness. ```bash scripts/quick_validate.py ``` -------------------------------- ### Clone DAIV Repository Source: https://github.com/srtab/daiv/blob/main/README.md Clone the DAIV repository and navigate into the project directory. ```bash git clone https://github.com/srtab/daiv.git cd daiv ``` -------------------------------- ### Django Ninja API Route Registration Source: https://github.com/srtab/daiv/blob/main/AGENTS.md Registering a Django Ninja Router for API endpoints. This example shows how to add a router for a specific app and set URL names for reversing. ```python api.add_router("/", _router) ``` -------------------------------- ### Referencing Supporting Files in Agent Skills Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Shows how to reference helper scripts and templates within a skill's markdown documentation using relative paths. ```markdown ## Resources - Run `scripts/validate.py` to check prerequisites - Use `templates/report.md` as the output format ``` -------------------------------- ### Set Google Gemini API Key Environment Variable Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/llm-providers.md Before using Google Gemini, set your API key as an environment variable. Obtain your key from AI Studio. ```bash GOOGLE_API_KEY=your-api-key-here ``` -------------------------------- ### Get Old Line Number with Git Show and Grep Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/references/gitlab-delivery.md Retrieve the old_line number for context lines by showing the base_sha version of the file and grepping for the same snippet. This is required when anchoring on an unchanged line. ```bash git show : | grep -Fn "" ``` -------------------------------- ### Custom Review Rule Example Source: https://github.com/srtab/daiv/blob/main/docs/features/pull-request-assistant.md Define a custom review rule for external API calls within a specific path. This rule enforces setting an explicit timeout for all external API calls in 'src/payments/**'. ```markdown - *Every external API call in `src/payments/**` must set an explicit timeout.* ``` -------------------------------- ### DAIV Docker Compose Configuration Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md This is the main `docker-compose.yml` file for deploying DAIV. It defines all necessary services, their configurations, environment variables, and dependencies. Ensure you replace placeholder values like hostnames, API keys, and secrets with your actual credentials. ```yaml x-app-defaults: image: ghcr.io/srtab/daiv:latest restart: unless-stopped environment: DJANGO_SETTINGS_MODULE: daiv.settings.production DJANGO_SECRET_KEY: secret-key (1) DJANGO_ALLOWED_HOSTS: your-hostname.com,app,127.0.0.1 (2) DJANGO_REDIS_URL: redis://redis:6379/0 DJANGO_REDIS_SESSION_URL: redis://redis:6379/1 DJANGO_REDIS_CHECKPOINT_URL: redis://redis:6379/2 DAIV_EXTERNAL_URL: https://your-hostname.com (12) # Database settings DB_HOST: db DB_NAME: daiv DB_USER: daiv DB_PASSWORD: daivpass (3) DB_SSLMODE: prefer # Codebase settings CODEBASE_CLIENT: gitlab CODEBASE_GITLAB_URL: https://gitlab.com (4) CODEBASE_GITLAB_AUTH_TOKEN: gitlab-auth-token (5) CODEBASE_GITLAB_WEBHOOK_SECRET: gitlab-webhook-secret (6) # LLM Providers settings OPENROUTER_API_KEY: openrouter-api-key (8) # Email settings EMAIL_HOST: smtp.example.com EMAIL_PORT: 587 EMAIL_USE_TLS: true # Sandbox settings DAIV_SANDBOX_API_KEY: daiv-sandbox-api-key (9) # MCP settings (built-in supergateway containers) MCP_SENTRY_URL: http://mcp-sentry:8000/mcp (16) MCP_CONTEXT7_URL: http://mcp-context7:8000/mcp (16) # Authentication (configure via UI at /dashboard/configuration/ or via env vars) ALLAUTH_CLIENT_ID: oauth-client-id ALLAUTH_CLIENT_SECRET: oauth-client-secret services: db: image: postgres:17.6 container_name: daiv-db restart: unless-stopped environment: POSTGRES_DB: daiv POSTGRES_USER: daiv POSTGRES_PASSWORD: daivpass (10) volumes: - db-volume:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U daiv -d daiv"] interval: 10s timeout: 10s start_period: 30s retries: 5 redis: image: redis:latest restart: unless-stopped container_name: daiv-redis volumes: - redis-volume:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 app: <<: *x_app_default container_name: daiv-app ports: - "8000:8000" depends_on: db: condition: service_healthy restart: true redis: condition: service_healthy restart: true sandbox: condition: service_healthy worker: <<: *x_app_default command: sh /home/daiv/start-worker # volumes: (17) # - ./custom-skills:/home/daiv/data/skills:ro healthcheck: test: ["CMD-SHELL", "grep -q 'db_worker' /proc/*/cmdline 2>/dev/null"] interval: 30s timeout: 5s retries: 3 start_period: 30s ports: [] deploy: replicas: 1 (15) depends_on: app: condition: service_healthy restart: true scheduler: <<: *x_app_default container_name: daiv-scheduler command: sh /home/daiv/start-crontask healthcheck: test: ["CMD-SHELL", "grep -q 'crontask' /proc/*/cmdline 2>/dev/null"] interval: 30s timeout: 5s retries: 3 start_period: 30s ports: [] depends_on: app: condition: service_healthy restart: true sandbox: image: ghcr.io/srtab/daiv-sandbox:latest restart: unless-stopped container_name: daiv-sandbox group_add: - 987 (13) environment: DAIV_SANDBOX_API_KEY: daiv-sandbox-api-key (11) volumes: - /var/run/docker.sock:/var/run/docker.sock mcp-sentry: image: supercorp/supergateway:latest restart: unless-stopped container_name: daiv-mcp-sentry command: - --stdio - "npx @sentry/mcp-server@latest" - --outputTransport - streamableHttp - --healthEndpoint - "/healthz" - --stateful - --sessionTimeout - "300000" env_file: - config.secrets.env (14) healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/healthz"] interval: 30s timeout: 5s retries: 3 start_period: 30s mcp-context7: image: supercorp/supergateway:latest restart: unless-stopped container_name: daiv-mcp-context7 command: - --stdio - "npx @upstash/context7-mcp@latest" - --outputTransport - streamableHttp - --healthEndpoint - "/healthz" - --stateful - --sessionTimeout - "300000" env_file: - config.secrets.env healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/healthz"] interval: 30s timeout: 5s retries: 3 start_period: 30s volumes: db-volume: driver: local redis-volume: driver: local ``` -------------------------------- ### Configure Context7 MCP Server URL Source: https://github.com/srtab/daiv/blob/main/docs/customization/mcp-tools.md Set the URL for the Context7 MCP Server. The default uses an underscore, but if your deployment uses a hyphenated service name, adjust the URL accordingly. ```bash MCP_CONTEXT7_URL=http://mcp_context7:8000/mcp # Default; set to None to disable ``` -------------------------------- ### Remove Dead Lines - C# Example Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/references/few-shot-examples.md Demonstrates the removal of an unused parameter in a C# method. This is applicable when a parameter is declared but never used within the method's scope, and its removal does not alter the method's behavior. ```csharp public Index BuildIndex(IEnumerable items, bool verbose) { var idx = new Index(); foreach (var item in items) { idx.Add(item.Key, item.Value); } return idx; } ``` ```csharp public Index BuildIndex(IEnumerable items) { var idx = new Index(); foreach (var item in items) { idx.Add(item.Key, item.Value); } return idx; } ``` -------------------------------- ### SQL Injection Vulnerability Example Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/security-audit/examples/example-audit-output.md Illustrates a common SQL injection vulnerability where user input is directly interpolated into SQL queries. This can lead to unauthorized data access or modification. Always use parameterized queries to prevent such attacks. ```python # src/controllers/search.py:34 query = f"SELECT * FROM products WHERE name LIKE '%{request.args['q']}%'" cursor.execute(query) ``` -------------------------------- ### Insecure Direct Object Reference (IDOR) Vulnerability Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/security-audit/examples/example-audit-output.md Shows an example of an Insecure Direct Object Reference (IDOR) vulnerability where an export download endpoint lacks proper authorization checks. This allows any authenticated user to access any export file by guessing or enumerating IDs. ```python @app.route("/export//download") @login_required def download_export(export_id): export = Export.query.get_or_404(export_id) return send_file(export.path) # no ownership check ``` -------------------------------- ### Poll Job Status Response Source: https://github.com/srtab/daiv/blob/main/docs/features/jobs-api.md This JSON response shows the status and result of a specific job. It includes details like job ID, status, thread ID, the agent's result, and timestamps for creation, start, and finish. The `merge_request_url` is populated if the agent committed code changes. ```json { "job_id": "1adfbf7a-917e-4f2e-8f54-17a27c006ec5", "status": "SUCCESSFUL", "thread_id": "9c1e8a3c-9b7e-4c0d-a1f5-7e2c8d4b1a90", "result": "Here are the Python files...", "merge_request_url": null, "error": null, "created_at": "2026-03-27T18:22:39.012Z", "started_at": "2026-03-27T18:22:39.401Z", "finished_at": "2026-03-27T18:22:52.402Z" } ``` -------------------------------- ### Move Password Hashing to User Package (Go) Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/code-review/references/few-shot-examples.md Use this when password hashing logic is incorrectly placed within an HTTP handler. The fix involves creating a dedicated function in the appropriate package and updating the call site. ```go func RegisterHandler(w http.ResponseWriter, r *http.Request) { email := r.FormValue("email") password := r.FormValue("password") hash, err := bcrypt.GenerateFromPassword([]byte(password), 12) if err != nil { http.Error(w, "internal error", http.StatusInternalServerError) return } if err := store.CreateUser(email, string(hash)); err != nil { http.Error(w, "could not create user", http.StatusBadRequest) return } w.WriteHeader(http.StatusCreated) } ``` ```go const bcryptCost = 12 func HashPassword(plain string) (string, error) { b, err := bcrypt.GenerateFromPassword([]byte(plain), bcryptCost) if err != nil { return "", err } return string(b), nil } ``` -------------------------------- ### Add Package with Specific Version Source: https://github.com/srtab/daiv/blob/main/AGENTS.md Adds a Python package to the project with a specified version using uv. ```bash uv add == ``` -------------------------------- ### Fix Linting and Formatting Source: https://github.com/srtab/daiv/blob/main/AGENTS.md Applies automatic fixes for linting and code formatting using ruff and pyproject-fmt. Prefer this over `make lint`. ```bash make lint-fix # fix linting + formatting (ruff + pyproject-fmt; prefer over make lint) ``` -------------------------------- ### Display New API Key Source: https://github.com/srtab/daiv/blob/main/daiv/accounts/templates/accounts/api_keys.html This snippet displays a newly generated API key. The key is only shown once upon creation and should be copied immediately. ```html {% if new_key %} {% icon "check-circle" "mt-0.5 h-5 w-5 shrink-0 text-emerald-400" %} Your new API key Copy it now — you won't be able to see it again. `{{ new_key }}` Copy {% endif %} ``` -------------------------------- ### Deploy DAIV Stack Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md Deploy your DAIV stack using the docker stack deploy command. Ensure you are in the directory containing your stack.yml file. ```bash docker stack deploy -c stack.yml daiv ``` -------------------------------- ### Quick Link Card Partial Source: https://github.com/srtab/daiv/blob/main/DESIGN.md Django template partial for rendering a quick link card. Requires 'url', 'icon', 'title', 'description', and optional 'badge' context variables. ```django {% include "accounts/_quick_link_card.html" with url=target_url icon="key" title="API Keys" description="Manage tokens" badge=count %} ``` -------------------------------- ### Basic Slash Command Usage Source: https://github.com/srtab/daiv/blob/main/docs/features/slash-commands.md The general format for invoking any DAIV command or skill in comments. ```text @daiv / [arguments] ``` -------------------------------- ### Define Application Service Source: https://github.com/srtab/daiv/blob/main/docs/getting-started/deployment.md Configures the main application service, specifying the Docker image, environment variables, secrets, network access, port mapping, and deployment strategy. ```yaml app: image: ghcr.io/srtab/daiv:latest (5) environment: <<: *app_environment_defaults secrets: - django_secret_key - db_password - codebase_gitlab_auth_token - codebase_gitlab_webhook_secret - daiv_sandbox_api_key - openrouter_api_key - email_host_password - allauth_client_id - allauth_client_secret networks: - internal - external ports: - "8000:8000" deploy: <<: *deploy_defaults ``` -------------------------------- ### Configure DAIV MCP Server for Codex CLI Source: https://github.com/srtab/daiv/blob/main/docs/features/mcp-endpoint.md Add this TOML configuration to your project's or global `.codex/config.toml` file to connect the Codex CLI to the DAIV MCP server. ```toml [mcp_servers.daiv] url = "https://daiv.example.com/mcp/" ``` -------------------------------- ### SKILL.md Basic Structure Source: https://github.com/srtab/daiv/blob/main/docs/customization/agent-skills.md Defines the fundamental structure of a SKILL.md file, including YAML frontmatter for metadata and a basic markdown structure for skill instructions. ```markdown --- name: my-skill description: Brief description of what this skill does and when the agent should use it --- # My Skill ## Instructions 1. First, do this 2. Then, do that 3. Finally, verify the result ``` -------------------------------- ### Medium Plan Format Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/plan/SKILL.md This markdown format is suitable for more complex changes. It includes an overview, a step-by-step breakdown of changes with file references, testing strategies, and edge case considerations. ```markdown # [Title] ## Overview [Problem and solution summary] ## Changes 1. **[Step description]** — [purpose] - `file1.js` (line ~N) — [what changes] - `file2.js` — Create — [what to add] 2. **[Step description]** — [purpose] - `file3.js` — [what changes] ## Testing [What to test and how] ## Edge Cases [Scenarios to handle] ``` -------------------------------- ### Run Single Test Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/init/examples/agents-md-sample.md Executes a specific test case, useful for focused debugging. ```bash # Test (single) pytest tests/api/test_orders.py::test_create_order ``` -------------------------------- ### Activity Tracking Sequence Diagram Source: https://github.com/srtab/daiv/blob/main/docs/features/activity-tracking.md Illustrates the sequence of events from a trigger source to the creation and updating of an activity record, including job enqueuing and task execution. ```mermaid sequenceDiagram participant Source as Trigger Source participant Handler as Callback / API / Dispatcher participant DB as Database participant Worker as Job Worker participant Activity as Activity Record Source->>Handler: Event (webhook, API call, cron tick) Handler->>Worker: Enqueue job task Handler->>DB: Create Activity (status: Pending) Worker->>Worker: Execute agent Worker->>DB: Update task result (Running Activity->>DB: Sync status, timing, and result from task result ``` -------------------------------- ### Directory Structure for Multi-Domain Skills Source: https://github.com/srtab/daiv/blob/main/daiv/automation/agent/skills/skill-creator/SKILL.md Organizes a BigQuery skill by domain (finance, sales, product, marketing) to load only relevant context when a user inquires about a specific domain. ```directory structure bigquery-skill/ ├── SKILL.md (overview and navigation) └── reference/ ├── finance.md (revenue, billing metrics) ├── sales.md (opportunities, pipeline) ├── product.md (API usage, features) └── marketing.md (campaigns, attribution) ``` -------------------------------- ### Create DAIV API Key Source: https://github.com/srtab/daiv/blob/main/docs/integrations/rt/index.md Generate a new DAIV API key to resolve authentication issues. This command should be run from the DAIV management environment. ```python python manage.py create_api_key ```