Skip to content
Back to skills

Agdr

ASecurity

> In the context of the apexyard release-cut branch model (AgDR-0007), facing a compounding squash divergence that produced 99 merge conflicts on the v2.0.0 release PR, I decided to introduce a `/release-sync` skill invoked explicitly as the final step of `/release`, accepting that the sync requires a PR that goes through the normal Rex + CEO approval gate rather than running automatically.

  • 542 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
developmentgogit

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add me2resh/apexyard --skill agdr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agdr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agdr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/me2resh-agdr-90465269/badge)](https://www.skillsdirectory.com/skills/me2resh-agdr-90465269)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Add /release-sync skill to reconcile dev/main squash divergence after each release

> In the context of the apexyard release-cut branch model (AgDR-0007), facing a compounding squash divergence that produced 99 merge conflicts on the v2.0.0 release PR, I decided to introduce a `/release-sync` skill invoked explicitly as the final step of `/release`, accepting that the sync requires a PR that goes through the normal Rex + CEO approval gate rather than running automatically.

## Context

- The apexyard release flow squash-merges `dev → main` on every release (AgDR-0007). Each squash creates a SHA divergence: the squash commit on `main` has a different SHA than the equivalent un-squashed commits on `dev`, so `dev` still carries those commits as "unsynced" history.
- Over multiple releases the gap accumulates: by v2.0.2, there were 6 squash commits on `main` not present on `dev`.
- The v2.0.0 release PR suffered 99 conflicts caused by this accumulation. v2.0.1 + v2.0.2 worked around the problem by cherry-picking directly from `main`, but that only works for single-commit releases.
- The fix direction is a `main → dev` merge with `-X ours` (dev wins on conflicts, which is correct because dev already has the un-squashed equivalents). This makes the squash commits ancestors of `dev`, so future `dev → main` release PRs only see genuinely-new commits.
- Three fix candidates were evaluated (see #403 Mitigation section): explicit skill, branch protection rule, and switching from squash to merge-commit. The skill approach is lowest friction and compatible with the existing release flow.

## Options Considered

| Option | Pros | Cons |
|--------|------|------|
| **A. `/release-sync` skill — explicit, final step of `/release`** | Low friction; integrates into existing release ritual; idempotent; operator can review the sync PR; no new automation dependencies | Requires operator to remember the extra step; one PR per release lifecycle |
| **B. Auto-invoke `/release-sync` from within `/release` (no separate step)** | Zero operator ceremony — release automatically opens the sync PR | Adds two PRs to every release (release PR + sync PR) in a single skill invocation; harder to skip if not needed; mixes concerns in a single skill turn |
| **C. Switch from squash-merge to merge-commit on release PRs** | Eliminates divergence at source — no bookkeeping merge needed | Breaking change to release PR ergonomics; `main` log becomes noisier (all dev commits appear); requires branch protection rule changes; bigger framework decision with adopter-visible effects |
| **D. Branch protection "must be ancestor of dev" rule** | Mechanically enforced | Incompatible with squash-merge by design — squash never creates an ancestor relationship; effectively a non-starter |

## Decision

Chosen: **Option A (explicit `/release-sync` skill, final step of `/release`)**, because:

1. **Least friction** — the skill pattern is already established in the framework; operators know how it works.
2. **Preserves the discrete merge-gate moment** — the sync PR goes through Rex + CEO approval, same as any PR. This is deliberate: the sync merge commit touches dev HEAD and should be reviewed, even if it's a bookkeeping operation.
3. **Idempotent and safe** — if main and dev are already in sync, the skill exits 0 without creating a PR. Running it twice is harmless.
4. **Explicit over implicit** — Option B (auto-invoke) hides the sync inside `/release`, making the two-PR release lifecycle less visible. Explicit invocation makes the ceremony auditable.

Option C (merge-commit instead of squash) was considered carefully. It eliminates the problem at the source but changes the `main` branch's log in ways that affect adopters (they see every dev commit in `git log main`). That's a bigger architectural change than this issue warrants; it can be reconsidered as a separate AgDR if the team decides the tradeoff is worth it.

**Merge strategy direction:**

When `/release-sync` creates a sync branch from `upstream/dev` and runs `git merge upstream/main`:

- `-X ours` = our branch (dev-based) wins conflicts — **correct choice**
- `-X theirs` = incoming (main's squash commit) wins conflicts — wrong; would overwrite dev's un-squashed equivalents with the squash


The common confusion is that the issue description (#403) initially frames this as "dev wins" and associates it with `-X theirs`, but that framing is from the wrong perspective. In git merge semantics: "ours" = the branch you're on when you run `git merge`; "theirs" = the branch you're merging in. Since we branch from dev and merge main, "ours" = dev = the correct winner.

## Consequences

- Every `/release` invocation should be followed by `/release-sync vX.Y.Z` to file the sync PR. The `/release` SKILL.md is updated to document Step 9 as mandatory.
- The sync PR is short-lived (branch `sync/main-to-dev-after-vX.Y.Z`), goes through the normal gate, and is deleted after merge.
- If the sync step is skipped for a release, the divergence accumulates silently — the same root cause as before. The skill being explicit (not automatic) means operator discipline is still required.
- The skill is idempotent: if already in sync (e.g. because the release was a no-squash merge or the sync was done manually), it exits 0 without creating a PR.
- Framework-only guard: the skill refuses to run on managed projects, same as `/release`.

## Artifacts

- `.claude/skills/release-sync/SKILL.md` — new skill implementation
- `.claude/skills/release/SKILL.md` — updated to document Step 9 (invoke `/release-sync`)
- `.claude/hooks/tests/test_release_sync.sh` — smoke tests for the sync branch/PR shape
- Implementing ticket: `me2resh/apexyard#403`

Files in this skill

  • AgDR-0001-rule-mechanization-hooks.md13.2 KB
  • AgDR-0002-warning-to-blocker-upgrade.md3.4 KB
  • AgDR-0003-mermaid-c4-for-diagrams.md6.4 KB
  • AgDR-0004-analytics-and-consent.md6 KB
  • AgDR-0005-tag-based-upstream-drift.md6.3 KB
  • AgDR-0006-project-configurable-ticket-schema.md5.7 KB
  • AgDR-0007-release-cut-branch-model.md4.8 KB
  • AgDR-0008-changelog-fallback-for-squash-merged-forks.md5.2 KB
  • AgDR-0009-voice-prompts-on-pause.md8 KB
  • AgDR-0010-portfolio-config-and-self-healing.md11.8 KB
  • AgDR-0011-bootstrap-skill-exemption.md12 KB
  • AgDR-0012-approve-merge-streamline-and-harden.md9.7 KB
  • AgDR-0013-sunset-voice-prompts.md9.8 KB
  • AgDR-0014-launch-check-trend-tracking.md6.6 KB
  • AgDR-0015-command-context-over-pwd-in-hooks.md6.8 KB
  • AgDR-0016-journey-html-rendering.md8.8 KB
  • AgDR-0017-spike-skill-schema-and-exemptions.md14.5 KB
  • AgDR-0018-persona-naming-convention.md8.6 KB
  • AgDR-0019-audit-artefact-persistence.md9.6 KB
  • AgDR-0020-adopter-handbooks-for-rex.md10 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.