Skip to content

feat(stack): gstack-style non-destructive update mechanism - #11

Merged
Rwanbt merged 1 commit into
mainfrom
feat/non-destructive-updates
Jun 19, 2026
Merged

feat(stack): gstack-style non-destructive update mechanism#11
Rwanbt merged 1 commit into
mainfrom
feat/non-destructive-updates

Conversation

@Rwanbt

@Rwanbt Rwanbt commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Why

Make the stack continuously improvable: users must be able to detect repo updates simply and apply them without losing their personalization (à la gstack).

Principle — reference, don't copy

Shared layer = this git clone. Personal configs only reference it (@AGENTS.md). So an update is a git pull on the shared repo; personal files are never opened → zero personalization loss, even across users with totally different CLAUDE.md.

What

  • VERSION (semver) + stack-version header in AGENTS.md — version source of truth.
  • scripts/stack-update-check.sh — read-only detection (fetch + compare). Emits UP_TO_DATE / UPGRADE_AVAILABLE old→new (N commits) / OFFLINE / NOT_A_CLONE. Safe in a SessionStart hook.
  • scripts/stack-upgrade.sh — non-destructive: aborts on dirty tree, --ff-only, touches only the shared repo, reports changed *.example templates instead of overwriting machine-local copies.
  • /stack-upgrade skill — mirrors /gstack-upgrade (detect → ask → upgrade → report).
  • UPDATING.md — full model + the managed-block convention (STACK:BEGIN/END) for the rare inlined case.

Verification

  • bash -n OK on both scripts
  • stack-update-check.shUP_TO_DATE 1.0.0
  • stack-upgrade.sh correctly aborts on a dirty working tree (protects edits)
  • 38 ai_docs tests pass · docs + bash only, no source touched

Make stack updates detectable and safe so the method can evolve constantly
without ever destroying a user's personalization. Built on the "reference,
don't copy" principle: the shared layer is this git clone, personal configs
only reference it (@AGENTS.md), so a `git pull` updates everyone while each
user keeps their customizations.

- VERSION (semver) + stack-version header in AGENTS.md — version source of truth
- scripts/stack-update-check.sh — read-only detection (fetch + compare, never
  modifies anything; safe in a SessionStart hook)
- scripts/stack-upgrade.sh — non-destructive upgrade: aborts on a dirty tree,
  fast-forward only, touches only the shared repo, reports changed *.example
  templates instead of overwriting machine-local copies
- skills/stack-upgrade/SKILL.md — /stack-upgrade command (mirrors /gstack-upgrade)
- UPDATING.md — the full model + the managed-block convention for inlined cases
- README + CHANGELOG references

Verified: bash -n on both scripts; update-check → UP_TO_DATE 1.0.0; upgrade
correctly aborts on a dirty tree; 38 ai_docs tests pass.
@Rwanbt
Rwanbt merged commit 048715d into main Jun 19, 2026
5 checks passed
@Rwanbt
Rwanbt deleted the feat/non-destructive-updates branch June 19, 2026 07:30
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