Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 3.03 KB

File metadata and controls

46 lines (29 loc) · 3.03 KB

Codex Cloud workspace bootstrap

WrightKit keeps shared agent guidance outside individual product repositories. A Codex Cloud environment that checks out only one task repository must reconstruct that shared context before the agent starts work.

The canonical bootstrap is scripts/codex-cloud-bootstrap.sh. It prepares:

  • ~/.wrightkit/.github: workspace AGENTS.md plus routed durable policy under docs/, including docs/goal.md;
  • ~/.wrightkit/.agents: reusable WrightKit skills;
  • $CODEX_HOME/AGENTS.md (or ~/.codex/AGENTS.md): a small cloud entry point that routes Codex to the canonical shared context before repository-local guidance.

The task repository itself is not modified by bootstrap.

Codex Cloud setup

Use this version-controlled bootstrap as the environment setup command:

printf 'wrightkit bootstrap: downloading setup\n'
curl --fail --silent --show-error --location \
  --connect-timeout 10 --max-time 30 \
  https://raw.githubusercontent.com/wrightkit/.github/main/scripts/codex-cloud-bootstrap.sh \
  | bash

Keep durable engineering rules, testing policy, skills, and repository ownership guidance in GitHub. Do not duplicate them in the Codex Cloud environment instructions.

Both canonical shared-context repositories, wrightkit/.github and wrightkit/.agents, are publicly readable. The bootstrap therefore requires no WrightKit-specific GitHub token or secret. Git is explicitly non-interactive, each repository sync is logged before network activity, and stalled low-throughput HTTP transfers are bounded by Git's low-speed timeout.

The setup is intentionally idempotent: re-running it updates the shared context to the current main revision and rewrites only the generated Codex routing entry. Cached environments may retain shared context for the cache lifetime; no separate policy copy should be maintained in the environment configuration.

Repository scope

A normal environment should contain only the repository selected for the Codex task plus the shared context prepared above. The bootstrap does not clone unrelated WrightKit product repositories.

When a task genuinely requires another repository, make that dependency explicit in the environment/task setup rather than turning every environment into a full organization checkout. The workspace routing rules still determine semantic ownership even when the current environment cannot modify the owning repository.

Overrides

The bootstrap accepts these environment variables for controlled testing or alternate layouts:

  • WRIGHTKIT_CONTEXT_ROOT: shared context root; defaults to ~/.wrightkit;
  • CODEX_HOME: Codex home; defaults to ~/.codex;
  • WRIGHTKIT_GITHUB_REPO: source URL for the shared .github repository;
  • WRIGHTKIT_AGENTS_REPO: source URL for the shared .agents repository.

Required shared guidance is fail-closed: if the workspace router, product goal, routed docs, or shared skills cannot be prepared, setup exits with an error rather than allowing a task to proceed with incomplete WrightKit policy.