mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-21 12:20:48 +02:00
Detect host-native browser tools before offering the isolated local Chromium fallback, add a common readiness fixture, harden managed browser startup, and verify standards installs expose one canonical QA skill.
204 lines
9.2 KiB
Markdown
204 lines
9.2 KiB
Markdown
<!-- GENERATED by scripts/gstack2/generate-skill-tree.ts; do not edit. -->
|
|
<!-- GSTACK2_PROVENANCE source=document-release/SKILL.md.tmpl base=bb57306d98c97011b0919c6132705a15b1579781 blob=7621cb31290217b5c7cc8fb000e910b3dd38128f baseline_render_sha256=2aafac6ff412ccc65ce702ad4c705d23cd7639a39a84b4d034fe1e91a10220d2 ported_render_sha256=21de7096aa788e3c4206587761f3122016f4cfc3080ec07f07cd7698075307a5 disposition=BUG_FIX -->
|
|
<!-- GSTACK2_ROUTING replacement=$ship --mode Prepare --module document-release visibility=primary depth=deep mutation=docs-only web=optional -->
|
|
|
|
<!-- GSTACK2_LEGACY_BODY_START source=document-release -->
|
|
## Host-neutral runtime bindings
|
|
|
|
These assignments select stable paths only; they do not install anything or grant consent:
|
|
|
|
```bash
|
|
GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}"
|
|
GSTACK_ROOT="$GSTACK_HOME"
|
|
GSTACK_STATE_ROOT="$GSTACK_HOME"
|
|
GSTACK_BIN="$GSTACK_HOME/bin"
|
|
BUN_CMD="$GSTACK_BIN/bun"
|
|
B="$GSTACK_BIN/browse"
|
|
D="$GSTACK_BIN/gstack-design"
|
|
P="$GSTACK_BIN/make-pdf"
|
|
```
|
|
## Step 0: Detect platform and base branch
|
|
|
|
First, detect the git hosting platform from the remote URL:
|
|
|
|
```bash
|
|
git remote get-url origin 2>/dev/null
|
|
```
|
|
|
|
- If the URL contains "github.com" → platform is **GitHub**
|
|
- If the URL contains "gitlab" → platform is **GitLab**
|
|
- Otherwise, check CLI availability:
|
|
- `gh auth status 2>/dev/null` succeeds → platform is **GitHub** (covers GitHub Enterprise)
|
|
- `glab auth status 2>/dev/null` succeeds → platform is **GitLab** (covers self-hosted)
|
|
- Neither → **unknown** (use git-native commands only)
|
|
|
|
Determine which branch this PR/MR targets, or the repo's default branch if no
|
|
PR/MR exists. Use the result as "the base branch" in all subsequent steps.
|
|
|
|
**If GitHub:**
|
|
1. `gh pr view --json baseRefName -q .baseRefName` — if succeeds, use it
|
|
2. `gh repo view --json defaultBranchRef -q .defaultBranchRef.name` — if succeeds, use it
|
|
|
|
**If GitLab:**
|
|
1. `glab mr view -F json 2>/dev/null` and extract the `target_branch` field — if succeeds, use it
|
|
2. `glab repo view -F json 2>/dev/null` and extract the `default_branch` field — if succeeds, use it
|
|
|
|
**Git-native fallback (if unknown platform, or CLI commands fail):**
|
|
1. `git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'`
|
|
2. If that fails: `git rev-parse --verify origin/main 2>/dev/null` → use `main`
|
|
3. If that fails: `git rev-parse --verify origin/master 2>/dev/null` → use `master`
|
|
|
|
If all fail, fall back to `main`.
|
|
|
|
Print the detected base branch name. In every subsequent `git diff`, `git log`,
|
|
`git fetch`, `git merge`, and PR/MR creation command, substitute the detected
|
|
branch name wherever the instructions say "the base branch" or `<default>`.
|
|
|
|
---
|
|
|
|
# Document Release: Post-Ship Documentation Update
|
|
|
|
You are running the `$ship --mode Prepare --module document-release` workflow. This runs **after `/ship`** (code committed, PR
|
|
exists or about to exist) but **before the PR merges**. Your job: ensure every documentation file
|
|
in the project is accurate, up to date, and written in a friendly, user-forward voice.
|
|
|
|
You are mostly automated. Make obvious factual updates directly. Stop and ask only for risky or
|
|
subjective decisions.
|
|
|
|
**Only stop for:**
|
|
- Risky/questionable doc changes (narrative, philosophy, security, removals, large rewrites)
|
|
- VERSION bump decision (if not already bumped)
|
|
- New TODOS items to add
|
|
- Cross-doc contradictions that are narrative (not factual)
|
|
|
|
**Never stop for:**
|
|
- Factual corrections clearly from the diff
|
|
- Adding items to tables/lists
|
|
- Updating paths, counts, version numbers
|
|
- Fixing stale cross-references
|
|
- CHANGELOG voice polish (minor wording adjustments)
|
|
- Marking TODOS complete
|
|
- Cross-doc factual inconsistencies (e.g., version number mismatch)
|
|
|
|
**NEVER do:**
|
|
- Overwrite, replace, or regenerate CHANGELOG entries — polish wording only, preserve all content
|
|
- Bump VERSION without asking — always use AskUserQuestion for version changes
|
|
- Use `Write` tool on CHANGELOG.md — always use `Edit` with exact `old_string` matches
|
|
|
|
---
|
|
|
|
|
|
|
|
---
|
|
|
|
## Step 1: Pre-flight & Diff Analysis
|
|
|
|
1. Check the current branch. If on the base branch, **abort**: "You're on the base branch. Run from a feature branch."
|
|
|
|
2. Gather context about what changed:
|
|
|
|
```bash
|
|
git diff <base>...HEAD --stat
|
|
```
|
|
|
|
```bash
|
|
git log <base>..HEAD --oneline
|
|
```
|
|
|
|
```bash
|
|
git diff <base>...HEAD --name-only
|
|
```
|
|
|
|
3. Discover all documentation files in the repo:
|
|
|
|
```bash
|
|
find . -maxdepth 2 -name "*.md" -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.gstack/*" -not -path "./.context/*" | sort
|
|
```
|
|
|
|
4. Classify the changes into categories relevant to documentation:
|
|
- **New features** — new files, new commands, new skills, new capabilities
|
|
- **Changed behavior** — modified services, updated APIs, config changes
|
|
- **Removed functionality** — deleted files, removed commands
|
|
- **Infrastructure** — build system, test infrastructure, CI
|
|
|
|
5. Output a brief summary: "Analyzing N files changed across M commits. Found K documentation files to review."
|
|
|
|
---
|
|
|
|
## Step 1.5: Coverage Map (Blast-Radius Analysis)
|
|
|
|
Before touching any documentation file, build a **coverage map** of what shipped vs what's
|
|
documented. This is inspired by the Diataxis framework (tutorial / how-to / reference / explanation)
|
|
— but applied as an audit lens, not a generation tool.
|
|
|
|
1. **Extract public surface changes from the diff.** Scan `git diff <base>...HEAD` for:
|
|
- New exported functions, classes, commands, CLI flags, config options, API endpoints
|
|
- New skills, workflows, or user-facing capabilities
|
|
- Renamed or removed public surface (modules, commands, features)
|
|
- New environment variables, feature flags, or configuration knobs
|
|
|
|
2. **For each new/changed public surface item, assess documentation coverage:**
|
|
|
|
```
|
|
Coverage map:
|
|
[entity] [reference?] [how-to?] [tutorial?] [explanation?]
|
|
/new-skill ✅ AGENTS.md ❌ ❌ ❌
|
|
--new-flag ✅ README ✅ README ❌ ❌
|
|
FooProcessor ❌ ❌ ❌ ❌
|
|
```
|
|
|
|
Use these definitions:
|
|
- **Reference** — factual description of what it is, its API, its options (README tables, AGENTS.md skill lists, API docs)
|
|
- **How-to** — task-oriented: "how to do X with this" (README examples, CONTRIBUTING workflows)
|
|
- **Tutorial** — learning-oriented: step-by-step walkthrough for newcomers (getting started guides)
|
|
- **Explanation** — understanding-oriented: "why this works this way" (ARCHITECTURE decisions, design rationale)
|
|
|
|
3. **Output the coverage map.** Items with zero coverage are **critical gaps** — flag them for
|
|
Step 3. Items with reference-only coverage are **common gaps** — note them for the PR body.
|
|
|
|
4. **Architecture diagram drift detection.** If ARCHITECTURE.md (or any doc) contains ASCII
|
|
diagrams or Mermaid blocks, extract entity names (modules, services, data flows) from the
|
|
diagrams. Cross-reference against the diff. Flag any diagram entities that were renamed,
|
|
split, removed, or moved in the code.
|
|
|
|
The coverage map feeds into Steps 2-3 (what to audit and fix) and Step 9 (documentation debt
|
|
summary in the PR body). Do NOT auto-generate missing documentation pages — flag gaps only.
|
|
When significant gaps are found, suggest running `$ship --mode Prepare --module document-generate` to fill them.
|
|
|
|
---
|
|
|
|
## Lazy specialist phase: release-body
|
|
|
|
When the workflow reaches this phase, read `references/sections/document-release/release-body.md` completely and execute it before continuing. Do not summarize or skip its questions, pressure, gates, evidence, artifacts, mutation boundary, or exit behavior.
|
|
|
|
|
|
|
|
---
|
|
|
|
## Important Rules
|
|
|
|
- **Read before editing.** Always read the full content of a file before modifying it.
|
|
- **Never clobber CHANGELOG.** Polish wording only. Never delete, replace, or regenerate entries.
|
|
- **Never bump VERSION silently.** Always ask. Even if already bumped, check whether it covers the full scope of changes.
|
|
- **Be explicit about what changed.** Every edit gets a one-line summary.
|
|
- **Generic heuristics, not project-specific.** The audit checks work on any repo.
|
|
- **Discoverability matters.** Every doc file should be reachable from README or CLAUDE.md.
|
|
- **Coverage map informs, never generates.** The Diataxis coverage map flags gaps for the PR body
|
|
and future work. It does NOT auto-generate missing documentation pages or sections. When gaps
|
|
are found, suggest `$ship --mode Prepare --module document-generate` as the follow-up skill.
|
|
- **Diagram drift is advisory.** Flag stale architecture diagrams in the PR body but do not
|
|
auto-edit ASCII art or Mermaid blocks — they require human judgment to update correctly.
|
|
- **Voice: friendly, user-forward, not obscure.** Write like you're explaining to a smart person
|
|
who hasn't seen the code.
|
|
<!-- GSTACK2_LEGACY_BODY_END source=document-release -->
|
|
|
|
<!-- GSTACK2_BUG_FIX_START pr=679 anchor=GSTACK2_FIX_679_MATCH_USER_LANGUAGE -->
|
|
## Upstream judgment port: PR #679
|
|
|
|
[Match the user language](https://github.com/garrytan/gstack/pull/679)
|
|
|
|
### User-language rule
|
|
|
|
Write questions, progress updates, reports, and artifacts in the language used by the user. Source material, code identifiers, commands, and quotations may remain in their original language when translating them would reduce accuracy.
|
|
<!-- GSTACK2_BUG_FIX_END pr=679 -->
|