Skip to content

feat(AI-81): author stage-chapters SKILL.md scaffold#25

Merged
dastratakos merged 6 commits into
mainfrom
dean/ai-81-issue-14-author-skillmd-scaffold-frontmatter-prerequisites
May 4, 2026
Merged

feat(AI-81): author stage-chapters SKILL.md scaffold#25
dastratakos merged 6 commits into
mainfrom
dean/ai-81-issue-14-author-skillmd-scaffold-frontmatter-prerequisites

Conversation

@dastratakos

@dastratakos dastratakos commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Authors the structural skeleton of skills/stage-chapters/SKILL.md so the /stage-chapters skill works end-to-end except for chapter generation (deferred to Issue 11). Linear: AI-81.

Changes

  • New skills/stage-chapters/SKILL.md at the repo root with vercel-labs/skills frontmatter (name, description, user-invocable: true).
  • Prerequisites (fail-fast on missing stage-cli or non-git directory), Step 1 base detection (origin/HEADmainmaster), Step 2 merge-base diff retrieval with the three SHAs, Step 3 TODO placeholder for Issue 11, Step 4 JSON-shape docs matching ChaptersFileSchema in packages/cli/src/schema.ts, Step 5 stage-cli show "$TMPFILE".

Testing

  • Reviewed the documented JSON shape field-by-field against ChaptersFileSchema to confirm parity (scope variants, chapter / hunkRef / keyChange / lineRef constraints).
  • Doc-only change; no code, lint, or test surface affected.

Open in Stage

Adds skills/stage-chapters/SKILL.md at the repo root with vercel-labs/skills
frontmatter, prerequisites (stage-cli + git repo checks), base ref detection
(origin/HEAD → main → master), merge-base diff retrieval, JSON-shape
documentation matching ChaptersFileSchema, and the final stage-cli show step.
Step 3 (cluster + narrate) is left as a TODO pointing at Issue 11.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the stage-chapters skill, which automates the generation and visualization of Stage chapters for a local git branch. The review identified several technical inaccuracies in the git commands and shell scripts provided in the documentation: the command for detecting the base reference needs to be updated to return a symbolic name instead of a SHA, the diff command requires adjustment to correctly include uncommitted working-tree changes, and the timestamp generation for temporary files needs to be made portable for macOS environments.

Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated
@dastratakos dastratakos marked this pull request as ready for review May 4, 2026 07:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc2170db14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated
- Use the published npm package name `stagereview` (binary is `stage-cli`)
  in the install instructions
- Use `git rev-parse --abbrev-ref origin/HEAD` for base detection so the
  output is `origin/main` (a strippable ref name), not a commit SHA
- Drop the trailing `..` from `git diff "$MERGE_BASE"` so the output
  actually includes uncommitted working-tree changes for tracked files
- Replace `date +%s%N` with `mktemp` template so unique filename
  generation works on macOS BSD `date` (which has no `%N`)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a14ab7b59b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/stage-chapters/SKILL.md Outdated
…clones

Previously the skill stripped `origin/` from `origin/main`, leaving `<base>`
set to `main`. In single-branch clones (and after deleting a local `main`)
that local ref does not exist, so the subsequent `git merge-base <base> HEAD`
and `git rev-parse <base>` calls fail. Use the full remote-tracking ref
(`origin/main`) as `<base>` directly — git accepts it everywhere a commit-ish
is expected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6653b18178

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/stage-chapters/SKILL.md Outdated
Comment thread skills/stage-chapters/SKILL.md Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6653b18. Configure here.

Comment thread skills/stage-chapters/SKILL.md Outdated
…plate

- Step 2 now uses `git diff "$MERGE_BASE..HEAD"` (committed range only)
  so chapter `hunkRefs`/`lineRefs` reference the exact range the SPA
  renders for `committed` scope (`baseSha..headSha` per
  `packages/cli/src/routes/diff.ts`). Mixing in working-tree changes
  would produce hunks the SPA cannot show; instruct users to commit
  uncommitted edits first.
- JSON example now sets `baseSha = mergeBaseSha = $MERGE_BASE` so the
  SPA's `baseSha..headSha` query matches the chapter-generation range
  even when the base branch has advanced past the merge-base.
- mktemp template is `stage-chapters.XXXXXX` (no `.json` suffix). BSD
  `mktemp` returns the template verbatim when characters follow the
  X's, breaking uniqueness on macOS. `stage-cli show` reads JSON
  regardless of extension.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01f1cc9106

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/stage-chapters/SKILL.md
Comment thread skills/stage-chapters/SKILL.md
…acks

When `origin/HEAD` is unset (some clones, or after the user deletes the
local default branch) and there is no local `main`/`master`, the skill
previously aborted even though `origin/main`/`origin/master` were valid
review bases. Append them as the last two fallbacks before giving up.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11b7833702

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/stage-chapters/SKILL.md
Without an explicit guard, `git merge-base <base> HEAD` failing (unrelated
histories or shallow clones) leaves `MERGE_BASE` empty, and the subsequent
`git diff "..HEAD"` becomes `HEAD..HEAD` — an empty diff that would
silently produce zero chapters. Tell the agent to abort with a clear
error before continuing.
@dastratakos dastratakos merged commit 3929530 into main May 4, 2026
5 checks passed
@dastratakos dastratakos deleted the dean/ai-81-issue-14-author-skillmd-scaffold-frontmatter-prerequisites branch May 4, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant