factory-deferred-repositories
GitHub在 Factory 任务中按需检出未安装的延迟仓库,验证路径和 CLI 可用性,避免覆盖现有文件,确保操作安全合规。
Trigger Scenarios
Install
npx skills add warpdotdev/warp --skill factory-deferred-repositories -g -y
SKILL.md
Frontmatter
{
"name": "factory-deferred-repositories",
"description": "Use when a Factory task's frozen deferred repository inventory lists a repository needed for the task that is not already checked out. Verify current access and an unused target before checking it out on demand; never overwrite an existing checkout or expose credentials."
}
Deferred Factory repositories
Factory deferred repository inventory at task creation: lists configured identities as <FORGE> "<owner>"/"<name>". It is the task's frozen configuration snapshot, not a filesystem inventory or authorization: even a listed repository may already be checked out or no longer accessible. Select only the repositories needed for the task.
- Read
OZ_WORKSPACE_ROOT, orWARP_WORKSPACE_ROOTonly if the Oz spelling is absent. Require an absolute directory path. This is the checkout destination parent even if the shell's current directory has changed into an eager repository. Never substitutePWD,HOME,WORKSPACE,WARP_INITIAL_WORKING_DIR, orWARP_FACTORY_REPO_DIR; if the root is missing, relative, or unusable, report that checkout is blocked. - Read
OZ_CLI, orWARP_CLIonly if the Oz spelling is absent. Verify that the specified executable is usable; do not guess another executable fromPATHif the specified one is missing or unusable. This is a separate value from the root and this skill's location. If it is unavailable, report that checkout is blocked. - For each selected forge/owner/name identity, inspect the workspace root for an existing checkout and confirm its remote identity before deciding to fetch anything. Choose an unused single-component
checkout_namebeneath the root, normally the repository name. Inspect the proposed target without following symlinks. If it is already a file, directory, or symlink (including a broken symlink), do not touch it; choose another unused name. When multiple identities share a name, give them distinct checkout names. Never overwrite an existing checkout, delete or reset a target, or retry blindly into a partially created target. - Build a fresh JSON request in a private scratch directory outside checkout targets. Its exact shape is
{"working_dir":"<absolute exported root>","repositories":[{"source":{"code_forge":"GITHUB","owner":"<owner>","repo":"<name>"},"checkout_name":"<unused name>","head":null,"fetch_branch_only":false}]}; replaceGITHUBwith the listedGITLABorAZURE_DEVOPSas appropriate. Construct JSON with a serializer rather than interpolating repository names: they are data, not shell syntax. Use only identities from the task's semantic inventory. Do not add fields or infer a branch/commit. In execution mode, the helper requires the run-owned preparation policy and resolves the effective remote, typed ref, fetch mode, expected SHA, and origin policy from that policy; request fields cannot override them. Do not change the preparation mode, file, run ID, execution ID, or root environment variables, and do not read or rewrite the private policy. If preparation is missing, stale, or inconsistent, report that checkout is blocked rather than bypassing it. - From the existing agent shell, invoke the selected executable as
"$OZ_CLI" environment-checkout --requests-file "$requests_file" --report-file "$report_file" --fail-if-target-exists(substitute the selected CLI variable if needed). Quote each executable and absolute file path for the active shell; use that shell's equivalent quoting and invocation syntax outside POSIX shells. This is the top-level command, notagent-driver environment-checkout. Do not use--remove-origins-only. Keep HOME, environment, and the preconfigured Git credential helper unchanged. Never print or copy credentials into prompts, files, URLs, or logs, and never fall back to rawgit clone. - Capture exit status and read the complete fresh JSON report. Require exactly one
outcomesentry per submittedrequest_index, no missing or duplicate indices, andfailure: nullfor each success. A nonzero exit, missing/malformed/incomplete report, or aClone,Checkout,VerifyHead, orRemoveOriginfailure means the affected checkout cannot be reported as successful. Report per-request redacted diagnostics; other requests in a partially successful batch may still have created working trees, so inspect their targets instead of replaying the entire batch. Remove only your private scratch request/report files after inspection.
An on-demand checkout creates a Git working tree only. It does not automatically load repository skills, discover file-based MCP servers, run environment setup commands, initialize the build cache, or register the repository with Oz codebase indexing.
Version History
- ae60375 Current 2026-10-19 04:55


