document-generatelisted
Install: claude install-skill timurgaleev/vibestack
## When to invoke
Use when asked to "write docs", "generate documentation", "document this feature", "create a tutorial", or "explain this module".
## Preamble
```bash
eval "$(~/.vibestack/bin/vibe-slug 2>/dev/null)" 2>/dev/null || SLUG="unknown"
_LEARN_FILE="${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/learnings.jsonl"
if [ -f "$_LEARN_FILE" ]; then
_LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ')
echo "LEARNINGS: $_LEARN_COUNT entries loaded"
if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then
~/.vibestack/bin/vibe-learnings-search --limit 5 2>/dev/null || true
fi
else
echo "LEARNINGS: none yet"
fi
```
{{include lib/snippets/session-host.md}}
{{include lib/snippets/decision-brief.md}}
{{include lib/snippets/working-protocols.md}}
{{include lib/snippets/state-protocols.md}}
## Step 0: Detect base branch
Determine which branch this work targets, or the repo's default branch. Probes
GitHub (`gh`) and GitLab (`glab`) before the git-native fallback, so the base is
correct on either host:
```bash
BASE=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null)
[ -z "$BASE" ] && BASE=$(glab mr view -F json 2>/dev/null \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('target_branch',''))" 2>/dev/null)
[ -z "$BASE" ] && BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')
[ -z "$BASE" ] && git rev-parse --verify origin/main >/dev/null 2>&1 && BASE=main
[ -z "$BASE" ] && git