LLM Integration

This guide explains how to enable and optimize LLM (Large Language Model) agent support in your DV Flow Manager projects. With proper configuration, AI assistants like GitHub Copilot CLI, Claude, and OpenAI Codex can effectively discover, understand, and generate DFM flows for your projects.

Overview

DV Flow Manager provides built-in support for LLM agent integration through:

  1. Skill Discovery - The dfm show skills command lists available agent skills

  2. JSON Output - Machine-readable output for programmatic consumption

  3. Skill Documentation - Detailed capability documentation accessible to agents

  4. AGENTS.md - Project-level documentation for AI assistants

Why Enable LLM Support?

Enabling LLM support in your project allows AI assistants to:

  • Automatically discover your project’s build capabilities

  • Generate correct flow.yaml/flow.yaml configurations

  • Understand task dependencies and dataflow patterns

  • Debug and modify existing flows with minimal hallucination

  • Execute builds and simulations via the CLI

Creating AGENTS.md

The recommended way to enable LLM support is to create an AGENTS.md file in your project root. This file is automatically discovered by AI assistants.

Best Practices

  1. Keep it Concise - LLM context windows are limited, so focus on essential information

  2. Include Examples - Show common command patterns and task usage

  3. Document Configurations - List available configurations and their purposes

  4. Reference dfm Commands - Point agents to dfm show commands for detailed info

Defining Custom Skills

For packages that want to expose their capabilities to LLM agents, define skills as DataSet types tagged with std.AgentSkillTag.

Basic Skill Definition

package:
  name: my_package

  types:
    # Default skill for the package (recommended name: AgentSkill)
    - name: AgentSkill
      uses: std.DataSet
      tags:
        - std.AgentSkillTag
      doc: My package agent skill
      with:
        name:
          type: str
          value: "my-package-skill"
        desc:
          type: str
          value: "Build and test MyPackage components"
        skill_doc:
          type: str
          value: |
            # MyPackage Skill

            ## Quick Start
            ```yaml
            imports:
              - name: my_package
                as: mp
            tasks:
              - name: build
                uses: mp.Build
                with:
                  target: [my_module]
            ```

            ## Available Tasks
            - `Build` - Compiles the design
            - `Test` - Runs test suite
            - `Lint` - Code linting

Skill Fields

The std.AgentSkill type supports the following fields:

Field

Type

Description

name

str

Unique skill identifier (e.g., “hdl-simulation”)

desc

str

One-line description for listing

skill_doc

str

Full markdown documentation with examples

examples

list

List of YAML example snippets

related_tasks

list

List of related task names

path

str

Optional path to detailed documentation file

Discovering Skills

Use the dfm show skills command to discover available skills:

# List all skills
dfm show skills

# Filter by package
dfm show skills --package hdlsim.vlt

# Search by keyword
dfm show skills --search verilator

# Show full documentation for a specific skill
dfm show skills hdlsim.vlt.AgentSkill --full

# JSON output for programmatic use
dfm show skills --json

Verifying Agent Compatibility

To verify your project is properly configured for LLM agents:

  1. Check skill discovery:

    dfm show skills
    
  2. Verify JSON output:

    dfm show project --json
    dfm show tasks --json
    
  3. Test agent workflow:

    Try the sequence of commands an agent would use:

    dfm --help                    # Get skill.md path
    dfm show skills              # Discover capabilities
    dfm show tasks --package std # List available tasks
    dfm show task std.FileSet    # Get task details
    

Example: Complete Project Setup

Here’s a complete example of a project with LLM support enabled:

Project Structure

my_project/
├── AGENTS.md           # Agent documentation
├── flow.yaml             # Main flow definition
├── src/
│   └── rtl/
│       └── counter.sv
└── tb/
    └── counter_tb.sv

flow.yaml

package:
  name: my_project

  types:
    # Custom project skill
    - name: AgentSkill
      uses: std.DataItem
      tags:
        - std.AgentSkillTag
      with:
        name:
          type: str
          value: "my-project-build"
        desc:
          type: str
          value: "Build and simulate the counter design"
        skill_doc:
          type: str
          value: |
            # Counter Project

            ## Quick Start
            ```bash
            dfm run sim     # Build and run simulation
            dfm run test    # Run tests
            ```

            ## Tasks
            - `rtl` - RTL source files
            - `tb` - Testbench files
            - `build` - Compile simulation
            - `sim` - Run simulation

  tasks:
    - name: rtl
      uses: std.FileSet
      with:
        base: src/rtl
        type: systemVerilogSource
        include: "*.sv"

    - name: tb
      uses: std.FileSet
      needs: [rtl]
      with:
        base: tb
        type: systemVerilogSource
        include: "*.sv"

    - name: build
      uses: hdlsim.vlt.SimImage
      needs: [rtl, tb]
      with:
        top: [counter_tb]

    - name: sim
      uses: hdlsim.vlt.SimRun
      needs: [build]

AGENTS.md

# Counter Project

A simple counter design with Verilator simulation.

## Quick Start

```bash
dfm run sim    # Build and run simulation
```

## Tasks

| Task | Description |
|------|-------------|
| `build` | Compile counter RTL and testbench |
| `sim` | Run simulation |

## DFM Commands

```bash
dfm show skills           # List project capabilities
dfm show tasks            # List available tasks
dfm show project --json   # Get project structure
```