Skip to content

feat(#58): /update skill for syncing ops fork with upstream#61

Merged
atlas-apex merged 2 commits into
mainfrom
feature/#58-update-skill
Apr 17, 2026
Merged

feat(#58): /update skill for syncing ops fork with upstream#61
atlas-apex merged 2 commits into
mainfrom
feature/#58-update-skill

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

New /update skill automates the fork-sync flow. Single skill invocation takes an ops-fork user from "behind upstream" to "sync branch ready to push as PR" — replacing the manual git fetch → branch → merge → push → PR dance.

  • .claude/skills/update/SKILL.md — full process: pre-flight, preview, merge-or-rebase, conflict walker, next-steps printout
  • CLAUDE.md updated (27→31 skills; new /update row)
  • docs/multi-project.md "Upgrades" section now points at /update first, with the raw-command flow below it corrected to use a sync branch

Ships PRD-0002 change #1 (fork-distribution PRD opened in ops fork earlier today).

Divergence from the AC

AC #8 says "leaves updated local main for the user to push themselves." Two hooks in this repo make literal adherence impossible:

  • block-main-push.sh blocks git push <remote> main
  • block-main-push.sh also blocks git commit while on main — so a merge with conflicts cannot be completed on main

The skill instead leaves a sync branch ready to push. Same shape as every other change in this project. Documented in the skill's "Design notes" section. Open to changing this if the maintainer prefers the literal AC path.

Testing

  • Pre-flight logic smoke-tested against each failure mode (dirty tree, non-default branch, missing upstream remote)
  • Preview output matches git rev-list --count and git log --oneline — verified against the upstream/main → ops/main delta synced earlier today (10 commits, matches the flow that produced me2resh/ops#4)
  • --dry-run path exits after preview without mutation
  • Conflict-walker options trace to actual git commands (--ours / --theirs / editor pause + git add)
  • No unit tests — the skill is process documentation for Claude, not executable code

Glossary

Term Definition
ops fork User's fork of me2resh/apexstack used as their Chief-of-Staff ops repo
upstream sync Routine maintenance pull of new framework commits from me2resh/apexstack into the fork
sync branch Short-lived branch (chore/#N-sync-upstream-apexstack) that holds the merge from upstream until the PR is merged
drift banner Planned SessionStart hook (separate PR) that shows "N commits behind upstream — run /update" when the fork lags

Related

Single-command replacement for the manual "fetch → branch → merge →
push → PR" dance that fork maintainers run to pull upstream apexstack
changes into their ops fork.

What it does:
- Pre-flight: refuses on dirty tree, non-default branch, missing
  upstream remote. Tells the user exactly how to fix each case.
- Fetches upstream and origin.
- Previews the commit delta (ahead/behind) with capped 20-line lists.
- Asks merge-vs-rebase (default merge, preserves fork history).
- Creates a sync branch chore/#N-sync-upstream-apexstack and runs the
  merge/rebase there, walking per-file conflicts with three options
  (keep mine / accept upstream / open editor — default to editor
  since auto-resolution on a governance framework is risky).
- Leaves a sync branch ready to push + a pre-filled PR body listing
  commits pulled in. Does NOT push.

Divergence from the AC:

The AC says "leaves updated local main for the user to push
themselves". Two hooks make literal adherence impossible:

- block-main-push.sh blocks `git push <remote> main`
- block-main-push.sh also blocks `git commit` on main, so a merge
  with conflicts (which requires a commit to finalise) cannot be
  completed on main

Creating a sync branch sidesteps both and is the same shape the
project uses for every other change. Documented in the skill's
"Design notes" section.

Also updates:
- CLAUDE.md skills list (27 → 31, adds /update row)
- docs/multi-project.md "Upgrades" section points at /update first,
  with the raw-commands flow below it updated to use a sync branch

Closes #58

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review: PR #61

Commit: ecace4c3e74328863d1c6edaf2c86945900e1563

Summary

New /update skill automating the upstream sync flow, plus aligned doc updates in CLAUDE.md and docs/multi-project.md. Marker written: .claude/session/reviews/61-rex.approved.

Checklist Results

  • Architecture & Design: Pass
  • Code Quality: Pass (process doc, not executable code)
  • Testing: N/A (process doc for Claude)
  • Security: Pass
  • Performance: N/A
  • PR Description & Glossary: Pass (4 terms)
  • Technical Decisions (AgDR):Pass — divergence from AC #8 justified inline in "Design notes" + PR body

Findings

AC #8 divergence (sync branch vs. updated local main): Correct call. block-main-push.sh blocks both direct pushes to main and commits made while on main, making literal AC adherence mechanically impossible inside this repo. Sync-branch shape matches every other change in the project and routes the merge through the standard Rex+CEO gate. Transparently documented in the skill and PR body.

Conflict walker: Safe defaults — option (3) "open editor" is the right default since auto-resolution on a governance framework is risky. Bail-out path (--abort → checkout main → delete branch) is clean.

Process completeness: Pre-flight covers the three failure modes (no upstream, dirty tree, wrong branch). Network failure on fetch correctly exits rather than working from stale refs. Dry-run semantics (preview only, no staged-merge trap) is the right choice.

Minor (non-blocking)

  1. Skill count off-by-one: CLAUDE.md heading says "Available skills (31)" and the summary row says "31 slash commands", but the actual table has 29 rows pre-merge + 1 new /update = 30 post-merge. Recommend bumping both to 30 in a follow-up.
  2. Default-branch asymmetry: step 1c detects $DEFAULT_BRANCH dynamically, but step 3 onward hardcodes upstream/main / main. For forks defaulting to master, rev-list and merge targets would be wrong. Reuse $DEFAULT_BRANCH throughout.
  3. Tracking-issue heuristic (step 5): "Find or create a tracking issue. If a recent 'sync' issue is open, reuse its number" — worth naming the search, e.g. gh issue list --search "sync upstream in:title" --state open.

Verdict

APPROVED (posted as comment — cannot self-approve)


Reviewed by Rex (Code Reviewer Agent)
Reviewed commit: ecace4c3e74328863d1c6edaf2c86945900e1563

Adds missing blank lines around 8 fenced code blocks and 1 numbered
list in .claude/skills/update/SKILL.md. Pure formatting — no prose
or process changes.

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re-review at HEAD 2933a06 — APPROVED.

Delta from previously-approved ecace4c is 9 blank-line additions around fenced code blocks and one numbered list in .claude/skills/update/SKILL.md — pure markdownlint fix (MD031/MD032). No prose, process, or logic changes. CI green.

Prior approval carries over.


Reviewed by Rex (Code Reviewer Agent)
Reviewed commit: 2933a06e28a1e98aee8cdef18a0dcaaa0f610b08

@atlas-apex atlas-apex merged commit 0031f68 into main Apr 17, 2026
3 checks passed
@atlas-apex atlas-apex deleted the feature/#58-update-skill branch April 17, 2026 06:51
me2resh added a commit that referenced this pull request Apr 17, 2026
Adds an explicit "Approval marker — EXACT FORMAT REQUIRED" section
to .claude/agents/code-reviewer.md with:

- The canonical write command (three allowed shapes: git rev-parse,
  gh pr view --json headRefOid, printf '%s\n' "$SHA")
- CORRECT vs WRONG visual examples covering the four malformed
  shapes actually observed in the wild:
    - "PR: N\nSHA: …" labelled multi-line
    - JSON object
    - SHA with trailing timestamp
    - "APPROVED at <SHA>" prose prefix
- Explicit "don't write the marker on non-approved verdicts" rule
- Explicit "report and abort, don't fake completion" rule for sandbox
  failures
- Reference to the hook that validates (block-unreviewed-merge.sh)
  and the rule that forbids hand-editing (pr-workflow.md)

Motivation: on 2026-04-17 (apexstack PR #61) the agent wrote
`PR: 61\nSHA: 2933a06…` instead of the bare SHA, the hook rejected
it, and the workaround required hand-editing — a rule violation per
pr-workflow.md § "Mechanical enforcement". Agent file had no
marker-format guidance at all; this closes that gap.

Also adds a BLOCKING rule (#8) at the end of the Rules list pointing
back to the new section so the format requirement is visible from
the quick-scan list.

Closes #62
atlas-apex added a commit that referenced this pull request Apr 17, 2026
Adds an explicit "Approval marker — EXACT FORMAT REQUIRED" section
to .claude/agents/code-reviewer.md with:

- The canonical write command (three allowed shapes: git rev-parse,
  gh pr view --json headRefOid, printf '%s\n' "$SHA")
- CORRECT vs WRONG visual examples covering the four malformed
  shapes actually observed in the wild:
    - "PR: N\nSHA: …" labelled multi-line
    - JSON object
    - SHA with trailing timestamp
    - "APPROVED at <SHA>" prose prefix
- Explicit "don't write the marker on non-approved verdicts" rule
- Explicit "report and abort, don't fake completion" rule for sandbox
  failures
- Reference to the hook that validates (block-unreviewed-merge.sh)
  and the rule that forbids hand-editing (pr-workflow.md)

Motivation: on 2026-04-17 (apexstack PR #61) the agent wrote
`PR: 61\nSHA: 2933a06…` instead of the bare SHA, the hook rejected
it, and the workaround required hand-editing — a rule violation per
pr-workflow.md § "Mechanical enforcement". Agent file had no
marker-format guidance at all; this closes that gap.

Also adds a BLOCKING rule (#8) at the end of the Rules list pointing
back to the new section so the format requirement is visible from
the quick-scan list.

Closes #62

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
osama-abu-baker pushed a commit to osama-abu-baker/apexyard that referenced this pull request Jun 3, 2026
…e2resh#61)

* feat(me2resh#58): /update skill for syncing ops fork with upstream

Single-command replacement for the manual "fetch → branch → merge →
push → PR" dance that fork maintainers run to pull upstream apexstack
changes into their ops fork.

What it does:
- Pre-flight: refuses on dirty tree, non-default branch, missing
  upstream remote. Tells the user exactly how to fix each case.
- Fetches upstream and origin.
- Previews the commit delta (ahead/behind) with capped 20-line lists.
- Asks merge-vs-rebase (default merge, preserves fork history).
- Creates a sync branch chore/#N-sync-upstream-apexstack and runs the
  merge/rebase there, walking per-file conflicts with three options
  (keep mine / accept upstream / open editor — default to editor
  since auto-resolution on a governance framework is risky).
- Leaves a sync branch ready to push + a pre-filled PR body listing
  commits pulled in. Does NOT push.

Divergence from the AC:

The AC says "leaves updated local main for the user to push
themselves". Two hooks make literal adherence impossible:

- block-main-push.sh blocks `git push <remote> main`
- block-main-push.sh also blocks `git commit` on main, so a merge
  with conflicts (which requires a commit to finalise) cannot be
  completed on main

Creating a sync branch sidesteps both and is the same shape the
project uses for every other change. Documented in the skill's
"Design notes" section.

Also updates:
- CLAUDE.md skills list (27 → 31, adds /update row)
- docs/multi-project.md "Upgrades" section points at /update first,
  with the raw-commands flow below it updated to use a sync branch

Closes me2resh#58

* fix: markdownlint blank-lines-around-fences and lists in /update skill

Adds missing blank lines around 8 fenced code blocks and 1 numbered
list in .claude/skills/update/SKILL.md. Pure formatting — no prose
or process changes.

---------

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
osama-abu-baker pushed a commit to osama-abu-baker/apexyard that referenced this pull request Jun 3, 2026
… SHA (me2resh#66)

Adds an explicit "Approval marker — EXACT FORMAT REQUIRED" section
to .claude/agents/code-reviewer.md with:

- The canonical write command (three allowed shapes: git rev-parse,
  gh pr view --json headRefOid, printf '%s\n' "$SHA")
- CORRECT vs WRONG visual examples covering the four malformed
  shapes actually observed in the wild:
    - "PR: N\nSHA: …" labelled multi-line
    - JSON object
    - SHA with trailing timestamp
    - "APPROVED at <SHA>" prose prefix
- Explicit "don't write the marker on non-approved verdicts" rule
- Explicit "report and abort, don't fake completion" rule for sandbox
  failures
- Reference to the hook that validates (block-unreviewed-merge.sh)
  and the rule that forbids hand-editing (pr-workflow.md)

Motivation: on 2026-04-17 (apexstack PR me2resh#61) the agent wrote
`PR: 61\nSHA: 2933a06…` instead of the bare SHA, the hook rejected
it, and the workaround required hand-editing — a rule violation per
pr-workflow.md § "Mechanical enforcement". Agent file had no
marker-format guidance at all; this closes that gap.

Also adds a BLOCKING rule (me2resh#8) at the end of the Rules list pointing
back to the new section so the format requirement is visible from
the quick-scan list.

Closes me2resh#62

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
mosta7il pushed a commit to mosta7il/apexyard that referenced this pull request Jun 8, 2026
…e2resh#61)

* feat(me2resh#58): /update skill for syncing ops fork with upstream

Single-command replacement for the manual "fetch → branch → merge →
push → PR" dance that fork maintainers run to pull upstream apexstack
changes into their ops fork.

What it does:
- Pre-flight: refuses on dirty tree, non-default branch, missing
  upstream remote. Tells the user exactly how to fix each case.
- Fetches upstream and origin.
- Previews the commit delta (ahead/behind) with capped 20-line lists.
- Asks merge-vs-rebase (default merge, preserves fork history).
- Creates a sync branch chore/#N-sync-upstream-apexstack and runs the
  merge/rebase there, walking per-file conflicts with three options
  (keep mine / accept upstream / open editor — default to editor
  since auto-resolution on a governance framework is risky).
- Leaves a sync branch ready to push + a pre-filled PR body listing
  commits pulled in. Does NOT push.

Divergence from the AC:

The AC says "leaves updated local main for the user to push
themselves". Two hooks make literal adherence impossible:

- block-main-push.sh blocks `git push <remote> main`
- block-main-push.sh also blocks `git commit` on main, so a merge
  with conflicts (which requires a commit to finalise) cannot be
  completed on main

Creating a sync branch sidesteps both and is the same shape the
project uses for every other change. Documented in the skill's
"Design notes" section.

Also updates:
- CLAUDE.md skills list (27 → 31, adds /update row)
- docs/multi-project.md "Upgrades" section points at /update first,
  with the raw-commands flow below it updated to use a sync branch

Closes me2resh#58

* fix: markdownlint blank-lines-around-fences and lists in /update skill

Adds missing blank lines around 8 fenced code blocks and 1 numbered
list in .claude/skills/update/SKILL.md. Pure formatting — no prose
or process changes.

---------

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
mosta7il pushed a commit to mosta7il/apexyard that referenced this pull request Jun 8, 2026
… SHA (me2resh#66)

Adds an explicit "Approval marker — EXACT FORMAT REQUIRED" section
to .claude/agents/code-reviewer.md with:

- The canonical write command (three allowed shapes: git rev-parse,
  gh pr view --json headRefOid, printf '%s\n' "$SHA")
- CORRECT vs WRONG visual examples covering the four malformed
  shapes actually observed in the wild:
    - "PR: N\nSHA: …" labelled multi-line
    - JSON object
    - SHA with trailing timestamp
    - "APPROVED at <SHA>" prose prefix
- Explicit "don't write the marker on non-approved verdicts" rule
- Explicit "report and abort, don't fake completion" rule for sandbox
  failures
- Reference to the hook that validates (block-unreviewed-merge.sh)
  and the rule that forbids hand-editing (pr-workflow.md)

Motivation: on 2026-04-17 (apexstack PR me2resh#61) the agent wrote
`PR: 61\nSHA: d46ff2c…` instead of the bare SHA, the hook rejected
it, and the workaround required hand-editing — a rule violation per
pr-workflow.md § "Mechanical enforcement". Agent file had no
marker-format guidance at all; this closes that gap.

Also adds a BLOCKING rule (me2resh#8) at the end of the Rules list pointing
back to the new section so the format requirement is visible from
the quick-scan list.

Closes me2resh#62

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] /update command to sync ApexStack fork from upstream

2 participants