Usage
Options
| Option | Description | Default |
|---|---|---|
--graph <path> | Path to graph.json | .devgraph/graph.json |
--out-dir <dir> | Output directory | .devgraph/agents |
--service <name> | Generate for a specific service only | - |
--service-path <path> | Base path to service directories for inference | - |
--format <format> | Output format: agents or skills | agents |
--best-effort | Generate even with missing data and mark gaps as TODO | - |
--json | Output result as JSON instead of writing files | - |
Description
GeneratesAGENTS.md files or Agent Skills from the built graph. These outputs help coding assistants understand service metadata, owned paths, downstream relationships, APIs, and graph-aware workflows.
The command uses:
- top-level service metadata from
devgraph-service,devgraph-api, anddevgraph-env - hybrid graph ownership data from
knowledgeGraph - graph analysis questions and coverage gaps from
knowledgeGraph.analysis - filesystem landmarks such as
src/,app/,lib/,components/, andtests/ - commands inferred from package metadata when available
.devgraph/GRAPH_REPORT.mddevgraph query "<question>"
Examples
Generate agents for all services:AGENTS.md Output
Each generatedAGENTS.md includes:
- service commands
- dependencies and consumers
- APIs and environment variables
- owned paths and neighboring files when available
- graph-aware instructions to read
GRAPH_REPORT.mdand usedevgraph query
Agent Skills Format
Use--format skills to generate Agent Skills:
Output Structure
- read
.devgraph/GRAPH_REPORT.mdbefore broad architecture searches - prefer
devgraph query "<question>"for focused retrieval - use service-specific skills when they need commands, APIs, or owned paths
Orchestration Skill
Theorchestrating-devgraph-context skill helps one agent gather repo context and hand it to another agent without starting from scratch.
It tells agents to:
- read
.devgraph/GRAPH_REPORT.md - choose 3 to 6 focused questions from graph analysis, coverage gaps, services, dependencies, and APIs
- run
devgraph query "<question>"for each selected question - ask the user only for missing intent, target service, constraints, or done criteria
- write a Markdown handoff brief from
references/HANDOFF_TEMPLATE.md
- goal
- known context
- graph evidence
- decisions
- open questions
- suggested next agent task
Use Cases
- AI-assisted development
- onboarding and architecture handoff
- multi-agent context handoff
- generated service context from the hybrid graph