Use this skill when the user wants Codex to set up ugit CI for a repository.
This skill scaffolds .ugit/workflows/<workflow>/ packages. It does not
replace ugit create, ugit serve, ugit workflow run, ugit workflow logs,
or ugit pr create.
Read these references before editing workflow files:
references/workflow-contract.md
references/remote-validation.md
Reuse these template assets when you scaffold a workflow package:
templates/package.json.template.json
templates/run-ugit-ci.sh.template
Default workflow
Resolve the target repository.
- Default to the current working directory unless the user names another
repository path.
- Confirm the Git root with
git rev-parse --show-toplevel.
- Inspect any existing
.ugit/workflows/* packages before proposing a new
workflow name.
Inspect the repository before asking questions.
Collect signals in parallel:
- existing
.ugit/workflows/**/*
- package-manager files such as
package.json, pnpm-workspace.yaml,
pnpm-lock.yaml, package-lock.json, yarn.lock, and bun.lockb
- existing CI definitions such as
.github/workflows/*, .gitlab-ci.yml,
and .circleci/**/*
- common stack files such as
Cargo.toml, go.mod, pyproject.toml, and
Makefile
- repository connectivity details from
git remote -v and
git config --local --get ugit.machine
Prefer these sources when you infer the validation command:
- an existing root
ci script
- an obvious root script chain such as
lint, test, then build
- a command already used by existing CI files
- stack-native commands such as
cargo test, go test ./..., pytest, or
make test
Ask only for missing high-signal inputs:
- the workflow name when the repository does not already imply one
- the validation command when repository signals are ambiguous
- PR metadata only when the user explicitly wants
ugit pr create
Do not invent a placeholder ugit:ci command. If inference is weak, stop
and ask the user for the exact validation command to wrap.
Scaffold or update .ugit/workflows/<workflow>.
- Reuse an existing workflow package when the requested workflow already
exists.
- Otherwise create:
.ugit/workflows/<workflow>/package.json
.ugit/workflows/<workflow>/run-ugit-ci.sh
- Fill the template placeholders with the confirmed workflow name and the
repository command that should run from the repository root.
- Keep the workflow package minimal and set
run-ugit-ci.sh executable.
Verify the local workflow package shape.
- Confirm
package.json exists and defines scripts.ugit:ci.
- Confirm
run-ugit-ci.sh returns to the repository root before running the
wrapped command.
- Run
pnpm --dir .ugit/workflows/<workflow> run ugit:ci when the command
is safe to execute locally.
- If the underlying command is destructive or expensive, ask before running
it.
Verify ugit prerequisites before remote validation.
Stop before remote execution if any of these checks fail:
ugit is available. When you are inside this repository and the binary is
missing, build it with pnpm --filter ugit-cli build.
~/.local/share/ugit/config.json exists and includes the requested or
configured machine.
- the target repository resolves a ugit machine via
git config --local --get ugit.machine or an explicit -m
git remote get-url origin points at the ugit repository that ugit
commands will publish to, or the repository has already been created with
ugit create
- the workflow package still matches the contract in
references/workflow-contract.md
Remediation should point back to existing ugit commands instead of
reimplementing them:
- no machine binding:
ugit create -m <machine> [directory]
- no config or server access: fix
~/.local/share/ugit/config.json, SSH, or
ugit serve -m <machine>
- PR-backed CI requested: use
ugit pr create, not a custom branch-publish
flow
Offer remote validation only after prerequisites pass.
- Default smoke path:
ugit workflow run [-m <machine>] <workflow> [directory]
- capture the printed workflow ID
ugit workflow logs [-m <machine>] <workflowId> [directory]
- Use
ugit pr create --base <branch> --title <title> ... only when the
user explicitly asks for PR-backed CI or auto-merge semantics.
Close out with a practical summary.
Include:
- the inferred or confirmed validation command
- the workflow name and files created or updated
- the local smoke result
- whether remote validation ran or which prerequisite blocked it
1---2name: ugit-ci-setup3description: Inspect a repository, scaffold `.ugit/workflows/<workflow>/`, verify ugit prerequisites, and optionally trigger remote validation through the existing ugit CLI.4---56Use this skill when the user wants Codex to set up ugit CI for a repository.78This skill scaffolds `.ugit/workflows/<workflow>/` packages. It does not9replace `ugit create`, `ugit serve`, `ugit workflow run`, `ugit workflow logs`,10or `ugit pr create`.1112Read these references before editing workflow files:1314- `references/workflow-contract.md`15- `references/remote-validation.md`1617Reuse these template assets when you scaffold a workflow package:1819- `templates/package.json.template.json`20- `templates/run-ugit-ci.sh.template`2122## Default workflow23241. Resolve the target repository.25 - Default to the current working directory unless the user names another26 repository path.27 - Confirm the Git root with `git rev-parse --show-toplevel`.28 - Inspect any existing `.ugit/workflows/*` packages before proposing a new29 workflow name.30312. Inspect the repository before asking questions.32 Collect signals in parallel:33 - existing `.ugit/workflows/**/*`34 - package-manager files such as `package.json`, `pnpm-workspace.yaml`,35 `pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, and `bun.lockb`36 - existing CI definitions such as `.github/workflows/*`, `.gitlab-ci.yml`,37 and `.circleci/**/*`38 - common stack files such as `Cargo.toml`, `go.mod`, `pyproject.toml`, and39 `Makefile`40 - repository connectivity details from `git remote -v` and41 `git config --local --get ugit.machine`4243 Prefer these sources when you infer the validation command:44 - an existing root `ci` script45 - an obvious root script chain such as `lint`, `test`, then `build`46 - a command already used by existing CI files47 - stack-native commands such as `cargo test`, `go test ./...`, `pytest`, or48 `make test`4950 Ask only for missing high-signal inputs:51 - the workflow name when the repository does not already imply one52 - the validation command when repository signals are ambiguous53 - PR metadata only when the user explicitly wants `ugit pr create`5455 Do not invent a placeholder `ugit:ci` command. If inference is weak, stop56 and ask the user for the exact validation command to wrap.57583. Scaffold or update `.ugit/workflows/<workflow>`.59 - Reuse an existing workflow package when the requested workflow already60 exists.61 - Otherwise create:62 - `.ugit/workflows/<workflow>/package.json`63 - `.ugit/workflows/<workflow>/run-ugit-ci.sh`64 - Fill the template placeholders with the confirmed workflow name and the65 repository command that should run from the repository root.66 - Keep the workflow package minimal and set `run-ugit-ci.sh` executable.67684. Verify the local workflow package shape.69 - Confirm `package.json` exists and defines `scripts.ugit:ci`.70 - Confirm `run-ugit-ci.sh` returns to the repository root before running the71 wrapped command.72 - Run `pnpm --dir .ugit/workflows/<workflow> run ugit:ci` when the command73 is safe to execute locally.74 - If the underlying command is destructive or expensive, ask before running75 it.76775. Verify ugit prerequisites before remote validation.78 Stop before remote execution if any of these checks fail:79 - `ugit` is available. When you are inside this repository and the binary is80 missing, build it with `pnpm --filter ugit-cli build`.81 - `~/.local/share/ugit/config.json` exists and includes the requested or82 configured machine.83 - the target repository resolves a ugit machine via84 `git config --local --get ugit.machine` or an explicit `-m`85 - `git remote get-url origin` points at the ugit repository that `ugit`86 commands will publish to, or the repository has already been created with87 `ugit create`88 - the workflow package still matches the contract in89 `references/workflow-contract.md`9091 Remediation should point back to existing ugit commands instead of92 reimplementing them:93 - no machine binding: `ugit create -m <machine> [directory]`94 - no config or server access: fix `~/.local/share/ugit/config.json`, SSH, or95 `ugit serve -m <machine>`96 - PR-backed CI requested: use `ugit pr create`, not a custom branch-publish97 flow98996. Offer remote validation only after prerequisites pass.100 - Default smoke path:101 - `ugit workflow run [-m <machine>] <workflow> [directory]`102 - capture the printed workflow ID103 - `ugit workflow logs [-m <machine>] <workflowId> [directory]`104 - Use `ugit pr create --base <branch> --title <title> ...` only when the105 user explicitly asks for PR-backed CI or auto-merge semantics.1061077. Close out with a practical summary.108 Include:109 - the inferred or confirmed validation command110 - the workflow name and files created or updated111 - the local smoke result112 - whether remote validation ran or which prerequisite blocked it