Document release

From mr-daedalium/ostack-saas · View interactive version

Document release is an AI agent skill from the GitHub repository mr-daedalium/ostack-saas. Post-ship documentation update. Reads all project docs, cross-references the diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped, polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when asked to "update the docs", "sync documentation", or "post-sh

How to use this skill

Skill file

<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->

<!-- Regenerate: bun run gen:skill-docs -->

Preamble (run first)

_UPD=$(~/.claude/skills/ostack/bin/ostack-update-check 2>/dev/null || .claude/skills/ostack/bin/ostack-update-check 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD" || true
mkdir -p ~/.ostack/sessions
touch ~/.ostack/sessions/"$PPID"
_SESSIONS=$(find ~/.ostack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
find ~/.ostack/sessions -mmin +120 -type f -delete 2>/dev/null || true
_CONTRIB=$(~/.claude/skills/ostack/bin/ostack-config get ostack_contributor 2>/dev/null || true)
_PROACTIVE=$(~/.claude/skills/ostack/bin/ostack-config get proactive 2>/dev/null || echo "true")
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"
echo "PROACTIVE: $_PROACTIVE"
source <(~/.claude/skills/ostack/bin/ostack-repo-mode 2>/dev/null) || true
REPO_MODE=${REPO_MODE:-unknown}
echo "REPO_MODE: $REPO_MODE"

If PROACTIVE is "false", do not proactively suggest ostack skills — only invoke

them when the user explicitly asks. The user opted out of proactive suggestions.

If output shows UPGRADE_AVAILABLE <old> <new>: read ~/.claude/skills/ostack/ostack-upgrade/SKILL.md and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If JUST_UPGRADED <from> <to>: tell user "Running ostack v{to} (just updated!)" and continue.

AskUserQuestion Format

ALWAYS follow this structure:

  1. Recommendation: "Do X because Y." One sentence. Position first.
  2. Options: A) ... B) ... — two options, three max if genuinely needed. When an option involves effort, show both scales: (human: ~X / CC: ~Y)

Skip AskUserQuestion entirely if there's a clear right answer — just do it and report.

Never hedge. Never pad with "great question." Never restate context the user already has. Compress ruthlessly. Trust the user to keep up.

Conviction and Completeness — Often Wrong, Never in Doubt

AI makes the marginal cost of completeness near-zero. Do the complete thing. But the deeper question is whether you're completing the right thing.

Say No to 1000 Things

Completeness without focus is waste. Before going deep, ask: is this the highest-leverage thing to build right now? If not, stop. The power of AI-assisted development is not doing everything — it's doing the right thing completely and fast. Say no to everything else.

Iteration as Truth

Rapid collision with reality beats analysis. Ship the smallest thing that tests the riskiest assumption. Wrong fast is better than right slow. Conviction means committing to a direction, shipping it, and course-correcting from real signal — not hedging with half-implementations.

Power Law

Concentrate effort, don't diversify. One complete feature beats three half-finished ones. One well-tested path beats broad shallow coverage. Find the 20% of work that drives 80% of value and do that completely.

When to be complete

Once you've decided something is worth doing:

| Task type | Human team | CC+ostack | Compression |

|-----------|-----------|-----------|-------------|

| Boilerplate / scaffolding | 2 days | 15 min | ~100x |

| Test writing | 1 day | 15 min | ~50x |

| Feature implementation | 1 week | 30 min | ~30x |

| Bug fix + regression test | 4 hours | 15 min | ~20x |

| Architecture / design | 2 days | 4 hours | ~5x |

| Research / exploration | 1 day | 3 hours | ~3x |

Repo Ownership Mode — See Something, Say Something

REPO_MODE from the preamble tells you who owns issues in this repo:

See Something, Say Something: Whenever you notice something that looks wrong during ANY workflow step — not just test failures — flag it briefly. One sentence: what you noticed and its impact. In solo mode, follow up with "Want me to fix it?" In collaborative mode, just flag it and move on.

Never let a noticed issue silently pass. The whole point is proactive communication.

Search Before Building

Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — search first. Read ~/.claude/skills/ostack/ETHOS.md for the full philosophy.

Three layers of knowledge:

Eureka moment: When first-principles reasoning reveals conventional wisdom is wrong, name it clearly:

"EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."

Carry that insight into the rest of the skill instead of treating it like a side note.

WebSearch fallback: If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."

Contributor Mode

If _CONTRIB is true: you are in contributor mode. You're a ostack user who also helps make it better.

At the end of each major workflow step (not after every single command), reflect on the ostack tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by ostack code or skill markdown — file a field report. Maybe our contributor will help make us better!

Calibration — this is the bar: For example, $B js "await fetch(...)" used to fail with SyntaxError: await is only valid in async functions because ostack didn't wrap expressions in async context. Small, but the input was reasonable and ostack should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.

NOT worth filing: user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.

To file: write ~/.ostack/contributor-logs/{slug}.md with all sections below (do not truncate — include every section through the Date/Version footer):

# {Title}

Hey ostack team — ran into this while using /{skill-name}:

**What I was trying to do:** {what the user/agent was attempting}
**What happened instead:** {what actually happened}
**My rating:** {0-10} — {one sentence on why it wasn't a 10}

## Steps to reproduce
1. {step}

## Raw output

{paste the actual error or unexpected output here}


## What would make this a 10
{one sentence: what ostack should have done differently}

**Date:** {YYYY-MM-DD} | **Version:** {ostack version} | **Skill:** /{skill}

Slug: lowercase, hyphens, max 60 chars (e.g. browse-js-no-await). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed ostack field report: {title}"

Completion Status Protocol

When completing a skill workflow, report status using one of:

Escalation

It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."

Bad work is worse than no work. You will not be penalized for escalating.

Escalation format:

STATUS: BLOCKED | NEEDS_CONTEXT
REASON: [1-2 sentences]
ATTEMPTED: [what you tried]
RECOMMENDATION: [what the user should do next]

Plan Status Footer

When you are in plan mode and about to call ExitPlanMode:

  1. Check if the plan file already has a ## OSTACK REVIEW REPORT section.
  2. If it DOES — skip (a review skill already wrote a richer report).
  3. If it does NOT — run this command:

\\\`bash

~/.claude/skills/ostack/bin/ostack-review-read

\\\`

Then write a ## OSTACK REVIEW REPORT section to the end of the plan file:

standard report table with runs/status/findings per skill, same format as the review

skills use.

\\\`markdown

OSTACK REVIEW REPORT

| Review | Trigger | Why | Runs | Status | Findings |

|--------|---------|-----|------|--------|----------|

| CEO Review | \/plan-ceo-review\ | Scope & strategy | 0 | — | — |

| Codex Review | \/codex review\ | Independent 2nd opinion | 0 | — | — |

| Eng Review | \/plan-eng-review\ | Architecture & tests (required) | 0 | — | — |

| Design Review | \/plan-design-review\ | UI/UX gaps | 0 | — | — |

VERDICT: NO REVIEWS YET — run \/autoplan\ for full review pipeline, or individual reviews above.

\\\`

PLAN MODE EXCEPTION — ALWAYS RUN: This writes to the plan file, which is the one

file you are allowed to edit in plan mode. The plan file review report is part of the

plan's living status.

Step 0: Detect base branch

Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.

  1. Check if a PR already exists for this branch:

gh pr view --json baseRefName -q .baseRefName

If this succeeds, use the printed branch name as the base branch.

  1. If no PR exists (command fails), detect the repo's default branch:

gh repo view --json defaultBranchRef -q .defaultBranchRef.name

  1. If both commands fail, fall back to main.

Print the detected base branch name. In every subsequent git diff, git log,

git fetch, git merge, and gh pr create command, substitute the detected

branch name wherever the instructions say "the base branch."


Document Release: Post-Ship Documentation Update

You are running the /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:

Never stop for:

NEVER do:


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."
  1. Gather context about what changed:
git diff <base>...HEAD --stat
git log <base>..HEAD --oneline
git diff <base>...HEAD --name-only
  1. Discover all documentation files in the repo:
find . -maxdepth 2 -name "*.md" -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.ostack/*" -not -path "./.context/*" | sort
  1. Classify the changes into categories relevant to documentation:
  1. Output a brief summary: "Analyzing N files changed across M commits. Found K documentation files to review."

Step 2: Per-File Documentation Audit

Read each documentation file and cross-reference it against the diff. Use these generic heuristics

(adapt to whatever project you're in — these are not ostack-specific):

README.md:

ARCHITECTURE.md:

describe things unlikely to change frequently.

CONTRIBUTING.md — New contributor smoke test:

CLAUDE.md / project instructions:

Any other .md files:

For each file, classify needed updates as:

table, updating a file path, fixing a count, updating a project structure tree.

(more than ~10 lines in one section), ambiguous relevance, adding entirely new sections.


Step 3: Apply Auto-Updates

Make all clear, factual updates directly using the Edit tool.

For each file modified, output a one-line summary describing what specifically changed — not

just "Updated README.md" but "README.md: added /new-skill to skills table, updated skill count

from 9 to 10."

Never auto-update:


Step 4: Ask About Risky/Questionable Changes

For each risky or questionable update identified in Step 2, use AskUserQuestion with:

Apply approved changes immediately after each answer.


Step 5: CHANGELOG Voice Polish

CRITICAL — NEVER CLOBBER CHANGELOG ENTRIES.

This step polishes voice. It does NOT rewrite, replace, or regenerate CHANGELOG content.

A real incident occurred where an agent replaced existing CHANGELOG entries when it should have

preserved them. This skill must NEVER do that.

Rules:

  1. Read the entire CHANGELOG.md first. Understand what is already there.
  2. Only modify wording within existing entries. Never delete, reorder, or replace entries.
  3. Never regenerate a CHANGELOG entry from scratch. The entry was written by /ship from the

actual diff and commit history. It is the source of truth. You are polishing prose, not

rewriting history.

  1. If an entry looks wrong or incomplete, use AskUserQuestion — do NOT silently fix it.
  2. Use Edit tool with exact old_string matches — never use Write to overwrite CHANGELOG.md.

If CHANGELOG was not modified in this branch: skip this step.

If CHANGELOG was modified in this branch, review the entry for voice:

rewrite the wording (not the content).


Step 6: Cross-Doc Consistency & Discoverability Check

After auditing each file individually, do a cross-doc consistency pass:

  1. Does the README's feature/capability list match what CLAUDE.md (or project instructions) describes?
  2. Does ARCHITECTURE's component list match CONTRIBUTING's project structure description?
  3. Does CHANGELOG's latest version match the VERSION file?
  4. Discoverability: Is every documentation file reachable from README.md or CLAUDE.md? If

ARCHITECTURE.md exists but neither README nor CLAUDE.md links to it, flag it. Every doc

should be discoverable from one of the two entry-point files.

  1. Flag any contradictions between documents. Auto-fix clear factual inconsistencies (e.g., a

version mismatch). Use AskUserQuestion for narrative contradictions.


Step 7: TODOS.md Cleanup

This is a second pass that complements /ship's Step 5.5. Read review/TODOS-format.md (if

available) for the canonical TODO item format.

If TODOS.md does not exist, skip this step.

  1. Completed items not yet marked: Cross-reference the diff against open TODO items. If a

TODO is clearly completed by the changes in this branch, move it to the Completed section

with **Completed:** vX.Y.Z (YYYY-MM-DD). Be conservative — only mark items with clear

evidence in the diff.

  1. Items needing description updates: If a TODO references files or components that were

significantly changed, its description may be stale. Use AskUserQuestion to confirm whether

the TODO should be updated, completed, or left as-is.

  1. New deferred work: Check the diff for TODO, FIXME, HACK, and XXX comments. For

each one that represents meaningful deferred work (not a trivial inline note), use

AskUserQuestion to ask whether it should be captured in TODOS.md.


Step 8: VERSION Bump Question

CRITICAL — NEVER BUMP VERSION WITHOUT ASKING.

  1. If VERSION does not exist: Skip silently.
  1. Check if VERSION was already modified on this branch:
git diff <base>...HEAD -- VERSION
  1. If VERSION was NOT bumped: Use AskUserQuestion:
  1. If VERSION was already bumped: Do NOT skip silently. Instead, check whether the bump

still covers the full scope of changes on this branch:

a. Read the CHANGELOG entry for the current VERSION. What features does it describe?

b. Read the full diff (git diff <base>...HEAD --stat and git diff <base>...HEAD --name-only).

Are there significant changes (new features, new skills, new commands, major refactors)

that are NOT mentioned in the CHANGELOG entry for the current version?

c. If the CHANGELOG entry covers everything: Skip — output "VERSION: Already bumped to

vX.Y.Z, covers all changes."

d. If there are significant uncovered changes: Use AskUserQuestion explaining what the

current version covers vs what's new, and ask:

The key insight: a VERSION bump set for "feature A" should not silently absorb "feature B"

if feature B is substantial enough to deserve its own version entry.


Step 9: Commit & Output

Empty check first: Run git status (never use -uall). If no documentation files were

modified by any previous step, output "All documentation is up to date." and exit without

committing.

Commit:

  1. Stage modified documentation files by name (never git add -A or git add .).
  2. Create a single commit:
git commit -m "$(cat <<'EOF'
docs: update project documentation for vX.Y.Z

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"
  1. Push to the current branch:
git push

PR body update (idempotent, race-safe):

  1. Read the existing PR body into a PID-unique tempfile:
gh pr view --json body -q .body > /tmp/ostack-pr-body-$$.md
  1. If the tempfile already contains a ## Documentation section, replace that section with the

updated content. If it does not contain one, append a ## Documentation section at the end.

  1. The Documentation section should include a doc diff preview — for each file modified,

describe what specifically changed (e.g., "README.md: added /document-release to skills

table, updated skill count from 9 to 10").

  1. Write the updated body back:
gh pr edit --body-file /tmp/ostack-pr-body-$$.md
  1. Clean up the tempfile:
rm -f /tmp/ostack-pr-body-$$.md
  1. If gh pr view fails (no PR exists): skip with message "No PR found — skipping body update."
  2. If gh pr edit fails: warn "Could not update PR body — documentation changes are in the

commit." and continue.

Structured doc health summary (final output):

Output a scannable summary showing every documentation file's status:

Documentation health:
  README.md       [status] ([details])
  ARCHITECTURE.md [status] ([details])
  CONTRIBUTING.md [status] ([details])
  CHANGELOG.md    [status] ([details])
  TODOS.md        [status] ([details])
  VERSION         [status] ([details])

Where status is one of:


Important Rules

who hasn't seen the code.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.