Skip to content

docs(worktree-isolation): stack-agnostic wtg reference + full setup guide#125

Merged
KailasMahavarkar merged 1 commit into
mainfrom
docs/wtg-setup-reference
Jul 7, 2026
Merged

docs(worktree-isolation): stack-agnostic wtg reference + full setup guide#125
KailasMahavarkar merged 1 commit into
mainfrom
docs/wtg-setup-reference

Conversation

@KailasMahavarkar

Copy link
Copy Markdown
Collaborator

What this adds

A ready-to-run, stack-agnostic reference implementation plus a complete
install/config guide, so anyone can adopt the multi-repo feature-group pattern
without reconstructing it from prose. Follow-up to #124 (the concept doc).

Why it is generic, not "our stack renamed"

Roles are arbitrary strings. The implementation hardcodes no role, language, or
framework - every stack specific lives in a CONFIG block of associative arrays:

WTG_ROLES=(api web)
declare -A WTG_REPO WTG_PORT WTG_RUN WTG_ENV   # keyed by your roles
WTG_PRIMARY_ROLE / WTG_OAUTH_PORT / WTG_OAUTH_VARS

dev.sh is generated from WTG_RUN[role] with %PORT%, %PRIMARY_PORT%,
%OAUTH_PORT% substitution; only WTG_PRIMARY_ROLE gets the OAuth port-swap.

Verifying

Proven against a stack with nothing in common with the author's: roles svc/ui,
Node run commands, ports 4000/5000, OAuth vars APP_URL/CALLBACK_URL.

wtg new feat svc ui   ->  svc :4000 (dev.sh), ui :5000 (dev.sh)
ui dev.sh   ->  exec pnpm dev --port 5000 --api http://localhost:4000
slot 1      ->  svc :4010 + "not the OAuth-registered port" warning

bash -n clean; new / env / st / ls / dev.sh generation all verified.
The optional statusline snippet in SETUP.md is verified too.

Files

  • references/wtg.reference.sh - the implementation
  • references/SETUP.md - install, config model, quickstart, command reference
  • SKILL.md - links to both

…uide

Adopters can install the pattern without reconstructing it, for ANY stack.

- references/wtg.reference.sh: complete, data-driven implementation. Roles are
  arbitrary; all stack specifics (repo map, base ports, run commands, env-file
  layout, primary/OAuth role, OAuth vars) live in a CONFIG block of associative
  arrays. The implementation hardcodes no role, language, or framework. Verified
  end-to-end against a throwaway Node stack (roles svc/ui, ports 4000/5000,
  custom OAuth vars): new, dev.sh generation with %PORT%/%PRIMARY_PORT% and the
  OAuth port-swap prelude, slot offset + warning, st, ls all correct.
- references/SETUP.md: prerequisites, install, the CONFIG model + placeholders,
  registry, quickstart, an optional statusline snippet (verified), the command
  reference, and a safe dry-run recipe.
- SKILL.md points to both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@KailasMahavarkar KailasMahavarkar merged commit 0474d73 into main Jul 7, 2026
4 checks passed
@KailasMahavarkar KailasMahavarkar deleted the docs/wtg-setup-reference branch July 7, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant