feat: skill prefix is now a persistent user choice (v0.12.11.0) (#571)

* feat: make skill prefix a persistent, interactive user setting

- Add --prefix flag alongside --no-prefix
- Read/write skill_prefix from ~/.gstack/config.yaml (true/false)
- Interactive prompt on first setup when no preference saved
- Non-TTY environments default to flat names (no prefix)
- Add cleanup_prefixed_claude_symlinks() for reverse direction
- Fix gstack-config sed portability (mktemp+mv instead of BSD sed -i '')
- Add SKILL_PREFIX to preamble output with namespace-aware instruction

* test: add prefix config tests + README switching instructions

8 structural tests for persistent prefix setting:
config reading, --prefix flag, config persistence, interactive
prompt, TTY fallback, reverse cleanup, cleanup ordering, welcome.

* chore: regenerate SKILL.md files with SKILL_PREFIX preamble

* chore: bump version and changelog (v0.12.11.0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: reframe changelog as feature, not mea culpa

* docs: update CONTRIBUTING + CLAUDE.md for prefix-aware vendoring

- CONTRIBUTING: vendoring now includes ./setup step for per-skill symlinks
- CONTRIBUTING: prefix choice documented in contributor workflow + dev diagram
- CONTRIBUTING: switching prefix mode section added
- CLAUDE.md: vendored symlink awareness section covers prefix setting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-27 09:08:15 -06:00
committed by GitHub
parent 22ad3e5b64
commit 43c078f19a
35 changed files with 394 additions and 20 deletions

View File

@@ -45,8 +45,10 @@ the issue, fix it, and open a PR.
```bash
# In your core project (the one where gstack annoyed you)
ln -sfn /path/to/your/gstack-fork .claude/skills/gstack
cd .claude/skills/gstack && bun install && bun run build
cd .claude/skills/gstack && bun install && bun run build && ./setup
```
Setup creates the per-skill symlinks (`qa -> gstack/qa`, etc.) and asks your
prefix preference. Pass `--no-prefix` to skip the prompt and use short names.
5. **Fix the issue** — your changes are live immediately in this project
6. **Test by actually using gstack** — do the thing that annoyed you, verify it's fixed
7. **Open a PR from your fork**
@@ -69,8 +71,8 @@ your local edits instead of the global install.
gstack/ <- your working tree
├── .claude/skills/ <- created by dev-setup (gitignored)
│ ├── gstack -> ../../ <- symlink back to repo root
│ ├── review -> gstack/review
│ ├── ship -> gstack/ship
│ ├── review -> gstack/review <- short names (default)
│ ├── ship -> gstack/ship <- or gstack-review, gstack-ship if --prefix
│ └── ... <- one symlink per skill
├── review/
│ └── SKILL.md <- edit this, test with /review
@@ -82,6 +84,10 @@ gstack/ <- your working tree
└── ...
```
Skill symlink names depend on your prefix setting (`~/.gstack/config.yaml`).
Short names (`/review`, `/ship`) are the default. Run `./setup --prefix` if you
prefer namespaced names (`/gstack-review`, `/gstack-ship`).
## Day-to-day workflow
```bash
@@ -309,25 +315,55 @@ When Conductor creates a new workspace, `bin/dev-setup` runs automatically. It d
**This is the recommended way to develop gstack.** Symlink your gstack checkout
into the project where you actually use it, so your changes are live while you
do real work:
do real work.
### Step 1: Symlink your checkout
```bash
# In your core project
# In your core project (not the gstack repo)
ln -sfn /path/to/your/gstack-checkout .claude/skills/gstack
cd .claude/skills/gstack && bun install && bun run build
```
Now every gstack skill invocation in this project uses your working tree. Edit a
template, run `bun run gen:skill-docs`, and the next `/review` or `/qa` call picks
it up immediately.
### Step 2: Run setup to create per-skill symlinks
**To go back to the stable global install**, just remove the symlink:
The `gstack` symlink alone isn't enough. Claude Code discovers skills through
individual symlinks (`qa -> gstack/qa`, `ship -> gstack/ship`, etc.), not through
the `gstack/` directory itself. Run `./setup` to create them:
```bash
cd .claude/skills/gstack && bun install && bun run build && ./setup
```
Setup will ask whether you want short names (`/qa`) or namespaced (`/gstack-qa`).
Your choice is saved to `~/.gstack/config.yaml` and remembered for future runs.
To skip the prompt, pass `--no-prefix` (short names) or `--prefix` (namespaced).
### Step 3: Develop
Edit a template, run `bun run gen:skill-docs`, and the next `/review` or `/qa`
call picks it up immediately. No restart needed.
### Going back to the stable global install
Remove the project-local symlink. Claude Code falls back to `~/.claude/skills/gstack/`:
```bash
rm .claude/skills/gstack
```
Claude Code falls back to `~/.claude/skills/gstack/` automatically.
The per-skill symlinks (`qa`, `ship`, etc.) still point to `gstack/...`, so they'll
resolve to the global install automatically.
### Switching prefix mode
If you vendored gstack with one prefix setting and want to switch:
```bash
cd .claude/skills/gstack && ./setup --no-prefix # switch to /qa, /ship
cd .claude/skills/gstack && ./setup --prefix # switch to /gstack-qa, /gstack-ship
```
Setup cleans up the old symlinks automatically. No manual cleanup needed.
### Alternative: point your global install at a branch
@@ -337,10 +373,10 @@ If you don't want per-project symlinks, you can switch the global install:
cd ~/.claude/skills/gstack
git fetch origin
git checkout origin/<branch>
bun install && bun run build
bun install && bun run build && ./setup
```
This affects all projects. To revert: `git checkout main && git pull && bun run build`.
This affects all projects. To revert: `git checkout main && git pull && bun run build && ./setup`.
## Community PR triage (wave process)