Skip to main content

Overview

The devgraph-service block defines a service in DevGraph. In the hybrid build, this block is the authoritative source for service identity, commands, dependencies, and optional owned paths. devgraph build still scans the rest of your repo for file-level structure, but service blocks define the service layer that the hybrid graph is built around.

Syntax

```devgraph-service
name: my-service
type: node
paths:
  - services/my-service
commands:
  dev: pnpm dev
  build: pnpm build
depends:
  - other-service
```

Fields

FieldRequiredDescription
nameYesUnique service identifier
typeYesService type
pathsNoRepo paths owned by this service
commandsNoObject with command definitions
dependsNoArray of service names this depends on

Service Types

TypeDescription
nodeNode.js service
nextjsNext.js application
pythonPython service
goGo service
rustRust service
databaseDatabase service
externalExternal API or service

Examples

Basic service

```devgraph-service
name: api
type: node
```

Service with owned paths

```devgraph-service
name: web
type: nextjs
paths:
  - apps/web
commands:
  dev: pnpm dev
  build: pnpm build
  start: pnpm start
```

Service with dependencies

```devgraph-service
name: api
type: node
paths:
  - services/api
commands:
  dev: pnpm dev
depends:
  - database
  - cache
```

Generated Output

Service blocks appear in:
  • graph.json top-level services
  • graph.json knowledgeGraph.nodes as service nodes
  • graph.json knowledgeGraph.edges through ownership and dependency edges
  • summary.md in the services overview
  • agents/{name}.md as service context files
  • system.mmd and codemap.mmd