Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions autoplan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,14 @@ After /office-hours completes, re-run the design doc check:
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```

Expand Down
22 changes: 17 additions & 5 deletions plan-ceo-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,17 @@ Then read CLAUDE.md, TODOS.md, and any existing architecture docs.
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```
If a design doc exists (from `/office-hours`), read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.
If a design doc exists, read it. Prefer repo-local `DESIGN.md` or `design-system.md` when present — that is the best signal for the current subproject in a monorepo. Otherwise, fall back to the most relevant `~/.gstack/projects/$SLUG/*-design-*.md` document from `/office-hours`. Use the selected document as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.

**Handoff note check** (reuses $SLUG and $BRANCH from the design doc check above):
```bash
Expand Down Expand Up @@ -620,8 +626,14 @@ After /office-hours completes, re-run the design doc check:
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```

Expand Down
12 changes: 9 additions & 3 deletions plan-ceo-review/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ Then read CLAUDE.md, TODOS.md, and any existing architecture docs.
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```
If a design doc exists (from `/office-hours`), read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.
If a design doc exists, read it. Prefer repo-local `DESIGN.md` or `design-system.md` when present — that is the best signal for the current subproject in a monorepo. Otherwise, fall back to the most relevant `~/.gstack/projects/$SLUG/*-design-*.md` document from `/office-hours`. Use the selected document as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.

**Handoff note check** (reuses $SLUG and $BRANCH from the design doc check above):
```bash
Expand Down
22 changes: 17 additions & 5 deletions plan-eng-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,17 @@ When evaluating architecture, think "boring by default." When reviewing tests, t
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```
If a design doc exists, read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design — check the prior version for context on what changed and why.
If a design doc exists, read it. Prefer repo-local `DESIGN.md` or `design-system.md` when present — that is the best signal for the current subproject in a monorepo. Otherwise, fall back to the most relevant `~/.gstack/projects/$SLUG/*-design-*.md` document from `/office-hours`. Use the selected document as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design — check the prior version for context on what changed and why.

## Prerequisite Skill Offer

Expand Down Expand Up @@ -530,8 +536,14 @@ After /office-hours completes, re-run the design doc check:
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```

Expand Down
12 changes: 9 additions & 3 deletions plan-eng-review/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,17 @@ When evaluating architecture, think "boring by default." When reviewing tests, t
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
```
If a design doc exists, read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design — check the prior version for context on what changed and why.
If a design doc exists, read it. Prefer repo-local `DESIGN.md` or `design-system.md` when present — that is the best signal for the current subproject in a monorepo. Otherwise, fall back to the most relevant `~/.gstack/projects/$SLUG/*-design-*.md` document from `/office-hours`. Use the selected document as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design — check the prior version for context on what changed and why.

{{BENEFITS_FROM}}

Expand Down
10 changes: 8 additions & 2 deletions scripts/resolvers/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,14 @@ After /${first} completes, re-run the design doc check:
setopt +o nomatch 2>/dev/null || true # zsh compat
SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
if [ -f DESIGN.md ]; then
DESIGN="$PWD/DESIGN.md"
elif [ -f design-system.md ]; then
DESIGN="$PWD/design-system.md"
else
DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
fi
[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
\`\`\`

Expand Down
12 changes: 12 additions & 0 deletions test/gen-skill-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,18 @@ describe('BENEFITS_FROM resolver', () => {
expect(engContent).toContain('skipping these sections');
expect(ceoContent).toContain('Follow its instructions from top to bottom');
});

test('plan reviews prefer repo-local design docs before ~/.gstack history', () => {
expect(ceoContent).toContain('if [ -f DESIGN.md ]; then');
expect(ceoContent).toContain('DESIGN="$PWD/DESIGN.md"');
expect(ceoContent).toContain('design-system.md');
expect(ceoContent).toContain('~/.gstack/projects/$SLUG');

expect(engContent).toContain('if [ -f DESIGN.md ]; then');
expect(engContent).toContain('DESIGN="$PWD/DESIGN.md"');
expect(engContent).toContain('design-system.md');
expect(engContent).toContain('~/.gstack/projects/$SLUG');
});
});

// --- {{INVOKE_SKILL}} resolver tests ---
Expand Down
Loading