Description
Provide a committed, idempotent setup script that can be pasted or invoked from Codex Cloud and Claude Code cloud environment configuration. It must provision this SvelteKit project and Backlog.md so future agents can follow the repository task workflow and run all required validation.
Acceptance Criteria
- #1 The script installs the pinned Backlog.md CLI and verifies the backlog command is available
- #2 The script installs project dependencies reproducibly with pnpm and prepares the SvelteKit workspace
- #3 The script works from Codex Cloud and Claude Code cloud setup contexts without relying on persistent shell exports or a fixed checkout path
- #4 Repository lint and production build pass after setup
Definition of Done
- #1 pnpm lint passes with zero errors
- #2 PUBLIC_ENTRA_CLIENT_ID=
pnpm check passes with zero errors - #3 PUBLIC_ENTRA_CLIENT_ID=
pnpm build passes with zero errors
Implementation Plan
-
Add a repository-root-aware Bash setup script with pinned pnpm and Backlog.md versions.
-
Install dependencies from the lockfile and verify the task-tracking and SvelteKit toolchain.
-
Exercise idempotency, lint, type-check, and production build; then finalize the Backlog task.
-
Rename the script to scripts/cloud-environment-setup.sh, add a prominent local-agent prohibition at the top, and rerun the full validation suite.
Implementation Notes
Added the cross-platform setup script with pinned pnpm 10.28.1 and Backlog.md 1.50.1, repository discovery, frozen dependency installation, and toolchain verification.
Validated direct invocation from outside the checkout; the script found the repository and completed successfully. pnpm lint, pnpm check, and pnpm build all passed.
Renamed the entry point to scripts/cloud-environment-setup.sh and added a top-of-file instruction prohibiting local agents from executing it.
Final Summary
Added an idempotent Codex Cloud and Claude Code cloud setup script that pins pnpm and Backlog.md, installs the lockfile, discovers the checkout from any working directory, and verifies the SvelteKit toolchain. Direct invocation from /tmp, lint, svelte-check, and the Cloudflare production build all passed.
Follow-up review changes renamed the script to scripts/cloud-environment-setup.sh and added an explicit cloud-only warning for local agents. Bash syntax, lint, svelte-check, and the production build passed without executing the cloud-only setup script locally.