docs: add codflow-update runbook for existing self-hosted installs - #112
Merged
Conversation
Self-hosters who completed codflow-setup have no guided path to take upstream updates: their wrangler.toml, .env, and .dev.vars files are gitignored, so a plain git pull leaves their config silently out of sync when templates change, and the alternative is redoing the full setup. Add a codflow-update agent skill that updates an existing install from this repository's main branch incrementally: - gates (existing install, remote, wrangler auth, clean tree, rollback point) followed by a no-change fetch + impact assessment - ff-only merge, dependency reinstall only when the lockfile changed - merges updated .example templates into the live gitignored config files while preserving the user's resource IDs, worker names, and domains (live configs backed up first) - creates only genuinely new resources/secrets; never regenerates existing secrets; never re-seeds a live store - applies new D1 migrations before deploying code (incremental via wrangler's d1_migrations table) - rebuilds before deploy: explicit npm run build for the dashboard (its deploy script does not build) and theme01; a failed build blocks the deploy - smoke-test verification, closing summary with rollback paths, and plain-language reporting of every step for non-developer users Also point codflow-setup's closing summary and the README Quick Setup section at the new runbook so existing installs can discover it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a new agent skill,
codflow-update, that updates an existing self-hosted CodFlow install to the latest code from this repository'smainbranch — without re-running the full setup.Why
Self-hosters who completed
codflow-setupcurrently have no guided path to take upstream updates. Theirwrangler.toml, root.env, and.dev.varsfiles are gitignored, so a plaingit pullleaves their config silently out of sync whenever templates change (missing vars/bindings → broken deploys), and the only alternative today is redoing the whole setup from scratch.What the runbook does
HEAD..origin/mainto categorize impact — new migrations, dependency changes, template changes, new secrets (via theenv.tsdiff), and which of the three workers need redeploying — then presents the plan.--ff-only(refuses cleanly if local commits exist); reinstalls dependencies only when the lockfile changed.~/.codflow-backups/first; re-runs the placeholder grep.BETTER_AUTH_SECRET/MCP_LOGIN_TICKET_SECRETmust stay identical across workers); never re-seeds a live store.d1_migrationstable), with a hard-stop rule on migration failure.npm run buildfor the dashboard (its deploy script does not build —PUBLIC_API_URLis baked at build time) and for theme01, so build failures surface before any deploy; a failed build blocks the deploy.Originheader), then prints a closing summary with rollback paths (wrangler rollback, old HEAD, config backups).The agent reports every step to the user in plain language as it goes, since the user may be a non-developer.
Also included:
codflow-setup's closing summary now tells new installs how to get future updates ("ask your agent to update CodFlow") instead of re-running setup.Both skill directories (
.agents/skills/and.opencode/skills/) carry identical copies, matching the existingcodflow-setupconvention.Related issues
None — new capability addressing recurring self-hoster feedback about taking updates.
How to test
Documentation-only change (no code paths touched). To review:
Read
.agents/skills/codflow-update/SKILL.mdend to end; verify each command matches the repo's actual scripts (cod-server/scripts/d1.mjs, deploy scripts,.env.examplekeys).Verify both directory copies are identical:
diff .agents/skills/codflow-update/SKILL.md .opencode/skills/codflow-update/SKILL.mdI ran
npm run typecheckandnpm testin the affected package(s)Checklist
docs:)Areas affected
docs (agent skills, README)