Onboard with a Coding Agent
Use this guide from the repository root with a coding agent that supports skills, such as Claude Code, Cursor, or Codex.
The agent will inspect the repository, generate .uigraph.yaml and the artifacts under .uigraph/, validate them, and sync them to UIGraph. It must not change application code. Nothing is sent to UIGraph until the sync command runs.
Before running the UIGraph skill, the agent must select a CLI runner and configure access to the target UIGraph workspace. It should inspect the machine and repository first. It should ask only when missing information would affect the artifacts or prevent the sync. The engineer must provide any required credentials and have permission to create a service in the target UIGraph workspace.
1. Select a CLI runner
Select the first available runner in this order:
- If
uigraph-cliexists, select it. - Otherwise, if Go exists, select
go run github.com/uigraph-oss/uigraph-cli@latest. - Otherwise, if Docker is running, select Docker.
- Otherwise, stop. Discuss how to proceed with the engineer.
Do not install the CLI, Go, or Docker. Do not change PATH or ask the engineer to restart their shell. Keep the selected runner for every command in this guide.
Dry-run examples:
| Runner | Command |
|---|---|
| Existing CLI | uigraph-cli sync --dry-run |
| Go | go run github.com/uigraph-oss/uigraph-cli@latest sync --dry-run |
For Docker, run the complete command from the repository root:
docker run --rm \
-e UIGRAPH_TOKEN \
-e UIGRAPH_GATEWAY_URL \
-v "$(pwd):/workspace" -w /workspace \
uigraph/uigraph-cli:latest sync --dry-runUse ${PWD}:/workspace for the mount in Windows PowerShell. Add --network host if a self-hosted gateway runs on localhost.
2. Set up authentication
Use an existing UIGRAPH_TOKEN if one is available. Never print it or write it to the repository.
If a token is not available, a workspace admin must create one:
- In UIGraph, open Settings, then Service Accounts.
- Select Create Service Account and name it, for example
Coding Agent. - Grant read and write access to Services, Diagrams, Docs, Maps, and Timeline.
- Open the account, select Create Token, and copy the token immediately. UIGraph shows it only once.
Export it in the shell that will run the sync:
export UIGRAPH_TOKEN="uig_your_token_here"Choose the destination
Choose the destination that matches the UIGraph workspace:
| Deployment | Configuration |
|---|---|
| Hosted UIGraph | Add --enterprise to each sync command. |
| Self-hosted UIGraph | Set UIGRAPH_GATEWAY_URL to the URL that exposes uigraph-gateway. |
For a self-hosted workspace:
export UIGRAPH_GATEWAY_URL="https://gateway.your-org.com"The CLI does not use UIGRAPH_API_URL. The token and, for a self-hosted workspace, the gateway URL must be available in the shell that runs the sync. A dry run needs neither because it does not send data.
3. Install the UIGraph skill
npx skills add uigraph-oss/skillsThe skill does not require the UIGraph MCP server. Install UIGraph MCP only if the agent needs to read existing data from UIGraph.
If the skill is not available in the current session after installation, locate and read its installed SKILL.md, then follow its instructions manually. All artifacts must be generated through the skill or its manually loaded instructions.
4. Generate artifacts with the skill
Use the installed UIGraph skill to generate the artifacts.
The skill follows this required workflow:
- Inspect the repository for API specifications, routes, migrations, schemas, documentation, diagrams, tests, deployment configuration, service metadata, and calls to other services or datastores.
- Ask the engineer which supported categories to generate: APIs, service dependencies, database schemas, architecture diagrams, docs, test packs, maps, and optional helper scripts. Offer cost tags and timeline only when the repository contains evidence for them.
- Resolve ownership, service boundaries, naming, and repository metadata from project evidence. Ask only when an unresolved detail would materially affect the output.
- Present a final plan that lists the files to create or update, detected sources, assumptions, validation steps, and any helper scripts under
.uigraph/scripts/. - Wait for an approval message containing
Generate.Generate the artifactsis valid.Go aheadandYesare not. - Generate only the approved files under
.uigraph/and create.uigraph.yamlat the repository root. - Validate the generated files and fix only files created during this run.
5. Validate the artifacts
Run the dry-run command for the selected runner from step 1. It validates .uigraph.yaml, checks every referenced file, and shows what the sync would send without uploading it.
An ml: configuration still reads from MLflow during a dry run so the CLI can list its models and experiments.
6. Sync and verify
After the dry run passes, run the same command without --dry-run.
Add --enterprise for hosted UIGraph. With Docker, use the container command from step 1. Then open Services in UIGraph and verify the service and its artifacts.
To keep the artifacts current, run the same sync from CI. See CI/CD Setup.