feat: project-local .gstack/ data storage with auto-migration#505
Open
alfadb wants to merge 7 commits intogarrytan:mainfrom
Open
feat: project-local .gstack/ data storage with auto-migration#505alfadb wants to merge 7 commits intogarrytan:mainfrom
alfadb wants to merge 7 commits intogarrytan:mainfrom
Conversation
gstack-slug now outputs a third variable PROJECT_DATA_DIR pointing to
{git-root}/.gstack, enabling project-local data storage instead of the
global ~/.gstack/projects/$SLUG path. Falls back to the legacy global
path for non-git environments.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- gstack-review-log: writes to $PROJECT_DATA_DIR instead of ~/.gstack/projects/$SLUG - gstack-review-read: reads from project-local first, falls back to legacy global path for backward compatibility - gstack-repo-mode: caches repo-mode.json to .gstack/local/ (gitignored) instead of ~/.gstack/projects/$SLUG Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…gement Browse daemon state (browse.json, logs) now lives in .gstack/local/ instead of .gstack/ root. The .gitignore strategy changes from blanket .gstack/ exclusion to a .gstack/.gitignore containing only "local/", enabling git-tracked shared data (designs, plans, reviews) in .gstack/. Migration: automatically removes .gstack/ line from project .gitignore and creates .gstack/.gitignore with local/ entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
getProjectEvalDir() now resolves via git root first (.gstack/evals/), falling back to the legacy slug-based ~/.gstack/projects/$SLUG/evals/ path for backward compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- utility.ts: generateSlugSetup uses $PROJECT_DATA_DIR - design.ts: design audit docs write to .gstack/designs/ - testing.ts: test plans write to .gstack/plans/ - review.ts: design doc lookup checks .gstack/designs/ first, falls back to legacy ~/.gstack/projects/$SLUG/ - gen-skill-docs.ts: sync local resolver copies with the above Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Merge conflict analysis (updated)Reviewed all 50 open PRs for file-level overlap. 8 PRs intersect with this one: High risk (manual merge needed)
Medium risk (different lines, likely auto-merge)
Low risk (cosmetic overlap)
No overlapNo other PR addresses project-local data storage or the Happy to rebase against any of these after they land. |
…nd docs - 12 .tmpl files: all ~/.gstack/projects/$SLUG/ references replaced with $PROJECT_DATA_DIR paths, legacy paths kept as fallback for reads - 28 SKILL.md files regenerated from updated templates - test/skill-validation.test.ts: adapt assertions for 3-line gstack-slug output and $PROJECT_DATA_DIR greptile patterns - review/greptile-triage.md: use gstack-slug for PROJECT_DATA_DIR - docs/skills.md: update path references Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bin/gstack-migrate-local: standalone migration script (--dry-run supported)
that handles two phases:
- Phase 1: ~/.gstack/projects/$SLUG/ → .gstack/{designs,plans,evals,...}/
- Phase 2: .gstack/ root flat files → subdirectories (reorganize in place)
Deduplicates automatically, handles browse.json/logs → .gstack/local/,
architecture docs, implementation plans, and roadmaps.
Integrated into preamble: auto-runs on first gstack use per project,
creates .migrated marker to skip on subsequent runs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9645db5 to
db02aac
Compare
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.
Summary
Moves project-scoped data from
~/.gstack/projects/$SLUG/to{git-root}/.gstack/, enabling:.gstack/local/(gitignored), shared data lives in.gstack/root (tracked)Directory structure
Auto-migration (two phases, fully automatic)
On first gstack skill invocation per project, the preamble runs
gstack-migrate-local:Phase 1 — Global → Local:
~/.gstack/projects/$SLUG/*→.gstack/{designs,plans,...}/Phase 2 — Flat → Organized:
.gstack/*-design-*.md→.gstack/designs/(reorganize existing files in place).gstack/local/, architecture docs, implementation plans, roadmaps.migratedmarker to skip on subsequent runs~/.claude/skills/gstack/bin/gstack-migrate-local [--dry-run]Changes
New files:
bin/gstack-migrate-local: standalone migration script (idempotent,--dry-runsupported)Core infrastructure:
bin/gstack-slug: newPROJECT_DATA_DIRoutput variablescripts/resolvers/preamble.ts+scripts/gen-skill-docs.ts: auto-runs migration in preambleData path updates:
bin/gstack-review-log,bin/gstack-review-read,bin/gstack-repo-mode: use project-local pathsbrowse/src/config.ts: browse state moves to.gstack/local/;.gitignoremanagement creates.gstack/.gitignoreinstead of blanket exclusiontest/helpers/eval-store.ts: evals write to.gstack/evals/utility.ts,design.ts,testing.ts,review.ts) and 12.tmplfiles updatedBackward compatibility
~/.gstack/projects/$SLUG/Breaking changes
.gstack/in.gitignorewill have that line removed and replaced with.gstack/.gitignorecontaininglocal/Test plan
bun run gen:skill-docsgenerates all 28 SKILL.md files successfullybun testpasses (only pre-existing "Contributor mode" failures, unrelated).tmpllegacy path references are in fallback positions only (verified via grep)gstack-migrate-local --dry-runcorrectly identifies files to migrate🤖 Generated with Claude Code