mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-01 19:25:10 +02:00
feat: design review lite in /review and /ship + gstack-diff-scope (v0.6.3) (#142)
* feat: gstack-diff-scope helper + design review checklist
bin/gstack-diff-scope categorizes branch changes into SCOPE_FRONTEND,
SCOPE_BACKEND, SCOPE_PROMPTS, SCOPE_TESTS, SCOPE_DOCS, SCOPE_CONFIG.
review/design-checklist.md is a 20-item code-level checklist with
HIGH/MEDIUM/LOW confidence tags for detecting design anti-patterns
from source code.
* feat: integrate design review lite into /review and /ship
Add generateDesignReviewLite() resolver, insert {{DESIGN_REVIEW_LITE}}
partial in review Step 4.5 and ship Step 3.5. Update dashboard to
recognize design-review-lite entries. Ship pre-flight uses
gstack-diff-scope for smarter design review recommendations.
* test: E2E eval for design review lite detection
Planted CSS/HTML fixtures with 7 design anti-patterns. E2E test
verifies /review catches >= 4 of 7 (Papyrus font, 14px body text,
outline:none, !important, purple gradient, generic hero copy,
3-column feature grid).
* chore: bump version and changelog (v0.6.3.0)
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:
Executable
+71
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
# gstack-diff-scope — categorize what changed in the diff against a base branch
|
||||
# Usage: eval $(gstack-diff-scope main) → sets SCOPE_FRONTEND=true SCOPE_BACKEND=false ...
|
||||
# Or: gstack-diff-scope main → prints SCOPE_*=... lines
|
||||
set -euo pipefail
|
||||
|
||||
BASE="${1:-main}"
|
||||
|
||||
# Get changed file list
|
||||
FILES=$(git diff "${BASE}...HEAD" --name-only 2>/dev/null || git diff "${BASE}" --name-only 2>/dev/null || echo "")
|
||||
|
||||
if [ -z "$FILES" ]; then
|
||||
echo "SCOPE_FRONTEND=false"
|
||||
echo "SCOPE_BACKEND=false"
|
||||
echo "SCOPE_PROMPTS=false"
|
||||
echo "SCOPE_TESTS=false"
|
||||
echo "SCOPE_DOCS=false"
|
||||
echo "SCOPE_CONFIG=false"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
FRONTEND=false
|
||||
BACKEND=false
|
||||
PROMPTS=false
|
||||
TESTS=false
|
||||
DOCS=false
|
||||
CONFIG=false
|
||||
|
||||
while IFS= read -r f; do
|
||||
case "$f" in
|
||||
# Frontend: CSS, views, components, templates
|
||||
*.css|*.scss|*.less|*.sass|*.pcss|*.module.css|*.module.scss) FRONTEND=true ;;
|
||||
*.tsx|*.jsx|*.vue|*.svelte|*.astro) FRONTEND=true ;;
|
||||
*.erb|*.haml|*.slim|*.hbs|*.ejs) FRONTEND=true ;;
|
||||
*.html) FRONTEND=true ;;
|
||||
tailwind.config.*|postcss.config.*) FRONTEND=true ;;
|
||||
app/views/*|*/components/*|styles/*|css/*|app/assets/stylesheets/*) FRONTEND=true ;;
|
||||
|
||||
# Prompts: prompt builders, system prompts, generation services
|
||||
*prompt_builder*|*generation_service*|*writer_service*|*designer_service*) PROMPTS=true ;;
|
||||
*evaluator*|*scorer*|*classifier_service*|*analyzer*) PROMPTS=true ;;
|
||||
*voice*.rb|*writing*.rb|*prompt*.rb|*token*.rb) PROMPTS=true ;;
|
||||
app/services/chat_tools/*|app/services/x_thread_tools/*) PROMPTS=true ;;
|
||||
config/system_prompts/*) PROMPTS=true ;;
|
||||
|
||||
# Tests
|
||||
*.test.*|*.spec.*|*_test.*|*_spec.*) TESTS=true ;;
|
||||
test/*|tests/*|spec/*|__tests__/*|cypress/*|e2e/*) TESTS=true ;;
|
||||
|
||||
# Docs
|
||||
*.md) DOCS=true ;;
|
||||
|
||||
# Config
|
||||
package.json|package-lock.json|yarn.lock|bun.lockb) CONFIG=true ;;
|
||||
Gemfile|Gemfile.lock) CONFIG=true ;;
|
||||
*.yml|*.yaml) CONFIG=true ;;
|
||||
.github/*) CONFIG=true ;;
|
||||
requirements.txt|pyproject.toml|go.mod|Cargo.toml|composer.json) CONFIG=true ;;
|
||||
|
||||
# Backend: everything else that's code (excluding views/components already matched)
|
||||
*.rb|*.py|*.go|*.rs|*.java|*.php|*.ex|*.exs) BACKEND=true ;;
|
||||
*.ts|*.js) BACKEND=true ;; # Non-component TS/JS is backend
|
||||
esac
|
||||
done <<< "$FILES"
|
||||
|
||||
echo "SCOPE_FRONTEND=$FRONTEND"
|
||||
echo "SCOPE_BACKEND=$BACKEND"
|
||||
echo "SCOPE_PROMPTS=$PROMPTS"
|
||||
echo "SCOPE_TESTS=$TESTS"
|
||||
echo "SCOPE_DOCS=$DOCS"
|
||||
echo "SCOPE_CONFIG=$CONFIG"
|
||||
Reference in New Issue
Block a user