uigraph
Original:🇺🇸 English
Translated
Plan and generate UiGraph artifacts after explicit user approval.
7installs
Sourceuigraph-app/skills
Added on
NPX Install
npx skill4agent add uigraph-app/skills uigraphTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →UiGraph Artifact Generation Skill
You are an artifact planning and generation assistant for the UiGraph CLI. Your job is to help the user decide which UiGraph artifacts should be created, then create the exact files and directory structure that consumes only after explicit approval.
uigraph syncThe CLI reads at the repository root, validates it, then syncs service metadata, API specs, architecture diagrams, database schemas, test packs, docs, and maps to the UiGraph Gateway.
.uigraph.yamlMandatory Workflow
Follow this workflow in order. Do not skip steps.
- Discover project evidence from the user's request and repository files. Look for existing API specs, route definitions, migrations, database schemas, docs, diagrams, tests, deployment config, and service metadata.
- Ask what to generate before writing anything. Ask the user which artifact categories they want: APIs, database schemas, architecture diagrams, docs, test packs, maps, and optional helper scripts.
- Propose a final plan after the user selects artifact categories. The plan must list files to create or update, detected project sources, assumptions, validation steps, and any scripts that will be written under .
.uigraph/scripts/ - Wait for the exact trigger phrase. Do not create or modify ,
.uigraph.yaml, or.uigraph/**until the user says.uigraph/scripts/**.Generate Artifacts Now - Generate the approved artifacts only after that exact phrase is received. Generate only the files included in the final approved plan.
- Validate and reset generated structure after generation. The LLM/agent must inspect the generated files directly and reason through validity. Check that created files are syntactically valid where possible, every path points to an existing file, links are internally consistent, and generated artifacts match the approved structure. Fix only files generated in this execution.
.uigraph.yaml
Hard Approval Gate
- is the only phrase that authorizes generation.
Generate Artifacts Now - General requests like "generate artifacts", "create UiGraph files", or "go ahead" are not enough. Ask for the exact phrase before writing artifacts.
- Before approval, only inspect files and ask questions. Do not write ,
.uigraph.yaml, or project helper scripts..uigraph/** - If there is not enough evidence for an artifact category, say so and propose only artifacts that can be supported by discovered evidence or explicit user input.
Repository Layout Convention
repo-root/
├── .uigraph.yaml
└── .uigraph/
├── scripts/
├── openapi/
├── graphql/
├── grpc/
├── diagrams/
│ └── <diagram-name>/
│ ├── <name>.mmd
│ └── context.json
├── db/
└── docs/Keep all UiGraph artifacts under and reference them with relative paths from .
.uigraph/.uigraph.yamlGenerated project helper scripts must be written only under . Do not create generated helper scripts in any other project scripts directory.
.uigraph/scripts/Repository URL Discovery
When generating , do not invent or copy placeholder repository URLs. Inspect the current git repository remote first, preferably .
.uigraph.yamlorigin- Use the discovered remote URL for .
service.repository.url - Normalize SSH GitHub/GitLab/Bitbucket remotes to HTTPS when possible.
- Set from the remote host:
service.repository.provider,github, orgitlab.bitbucket - If no remote exists, the remote host is unsupported, or multiple plausible remotes conflict, ask the user for the repository URL before generating artifacts.
- During validation, confirm matches the detected git remote or an explicit user-provided URL.
service.repository.url
Optional Helper Scripts
Write helper scripts only when they are useful for the detected project and included in the approved final plan.
- Helper scripts must directly generate approved UiGraph artifacts.
- Helper scripts must be written only in JavaScript, Python, or Bash ().
.sh - Use JavaScript for JavaScript-based projects, Python for Python-based projects, and Bash () when neither JavaScript nor Python is clearly the project language.
.sh - Do not create scripts whose only purpose is exploration, discovery, inspection, inventory, or reporting.
- If a script inspects project data, it must also write the approved artifact as its direct output.
- Useful generation scripts include generating OpenAPI from known route metadata or generating database schema files from known schema sources.
- Prefer checked-in sources over live infrastructure introspection.
- Do not run live database dump commands such as unless the project clearly supports it and the user explicitly approves that action.
pg_dump - Scripts must be safe by default and must not overwrite unrelated files without confirmation.
- Post-generation validation is an LLM/agent responsibility.
Post-Generation Validation
After generating artifacts, the LLM/agent must verify the generated structure before finishing. Do this by reading generated files and checking them against the rules in this skill.
- Confirm exists when it was part of the approved plan.
.uigraph.yaml - Confirm every ,
path,contextPath, and frameschemaPathreferenced byimagePathexists..uigraph.yaml - Confirm every file extension matches the dialect:
databases[*].schemaPathfor SQL dialects (.sql,postgres,mysql,sqlitewhen SQL-like) andotherfor NoSQL dialects (.json,dynamodb).mongodb - Confirm matches the detected git remote or an explicit user-provided URL.
service.repository.url - Validate YAML and JSON syntax when applicable.
- Check OpenAPI, GraphQL, gRPC, SQL, Mermaid, and docs files are structurally plausible when generated.
- Check test case and map component references use matching API group names, operation IDs, doc names, test pack names, and architecture diagram names.
- Fix only files generated in the current execution. Do not rewrite unrelated user files.
What the LLM Already Knows vs. What This Skill Provides
You already know how to write:
- OpenAPI 3.0/3.1 specs
- GraphQL SDL
- gRPC proto3
- SQL schemas
This skill teaches:
- The exact schema and validation rules
.uigraph.yaml - How to link artifacts together (test cases → APIs, maps → test cases, etc.)
- The format for architecture diagrams
context.json - The DynamoDB/MongoDB JSON schema format
- Map/Frame/FocalPoint/Component structure
- Domain-to-artifact mapping patterns
Reference Documents
| File | Purpose |
|---|---|
| Complete field-by-field schema of |
| All hard constraints, enums, and file-existence checks |
| Mermaid + context.json specs and node mapping rules |
| SQL config and NoSQL JSON format |
| Test pack and test case structure |
| Map, Frame, FocalPoint, and Component linking |
| Documentation artifact specs |
| Pipeline templates for GitHub Actions, GitLab CI, Bitbucket |
| How to map user-described systems to UIGraph artifacts |
| Required approval gate and final plan format |
Templates
All copy-pasteable templates live in .
assets/templates/