agentleFS
yamcodesyamcodes/arkenv/skills/sync-main/SKILL.md

sync-main

Skill147 starsChanged 23 days agoMITView on GitHub

Update the v0 docs archive on main (arkenv-v0.vercel.app) immediately without waiting for a new npm release. Use this skill whenever the user mentions 'hotfix docs', 'push doc changes live now', 'promote docs to main', 'bypass package release for docs', 'sync-main', 'sync main', or wants to rescue already-merged doc commits from dev. It handles cherry-picking to main and merging main back into dev to prevent git drift. Note: Production / arkenv.js.org tracks v1 — sync-main does not flip apex.

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    After the RC docs cutover (Option A), a push to main refreshes the v0 archive at https://arkenv-v0.vercel.app.

    line 12
  2. Very specific:

    Before performing any Git actions, you must analyze the changes between dev and main to classify the sync:

    line 17
  3. Distinctive:

    Run the following command to check the list of changed files:

    line 19
  4. Very specific:

    Doc-Only (Easy Case): All changed files are strictly under docs/, apps/www/, or are root-level Markdown files (matching the regex …

    line 27
  5. Very specific:

    If there are changes in the packages/ directory, do not execute any git commands automatically.

    line 55
  6. Very specific:

    Keep the doc changes on dev and let them deploy naturally on the next package release.

    line 62
  7. Distinctive:

    If the urgent doc fix is bundled in the *exact same commit* as unreleased package code, do not cherry-pick.

    line 71
  8. Distinctive:

    If the user explicitly approves Option 3, follow these steps using the helper script:

    line 78
  9. Very specific:

    If conflicts occur during reconciliation, prompt the user to help resolve them, commit, and push dev.

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sync Main

This skill enables you to safely sync documentation and tooling changes from the dev branch to main without waiting for the next package release, while ensuring that the dev and main branches remain in a clean, compatible topological state (preventing future merge conflicts).

After the RC docs cutover (Option A), a push to main refreshes the v0 archive at https://arkenv-v0.vercel.app. It does not deploy Production / arkenv.js.org (that tracks v1). Use this skill for urgent legacy v0 doc fixes, not for the live v1 site.

Analysis Step (Do This First)

Before performing any Git actions, you must analyze the changes between dev and main to classify the sync:

Run the following command to check the list of changed files:

git fetch origin
git diff --name-only origin/main...origin/dev

Based on the file list, classify the sync into one of the following three categories:

  1. Doc-Only (Easy Case): All changed files are strictly under docs/, apps/www/, or are root-level Markdown files (matching the regex ^(docs/|apps/www/|[^/]+\.md)$).
  2. Infra-Only (Easy Case + Force): There are no changes to package code, tests, or examples, but there are changes to workflows, scripts, or skills (e.g. .github/workflows/, scripts/, skills/).
  3. Code Changes (Hard Case): There are modifications to files in the packages/, tests/, examples/, or apps/ directories (unreleased library features, fixes, or test/example updates).

Easy Case Workflows

Category 1: Doc-Only Sync

Since the changes are strictly doc-only, they are safe to sync directly:

  • Instruct the user that they can run the Sync main workflow normally.
  • Or trigger it automatically via GitHub CLI:
    gh workflow run sync-main.yml --ref dev

Category 2: Infra-Only Sync

Since the changes contain tooling or workflow updates but do not touch the library package code, they can be synced, but the workflow's safety check will block them unless overridden:

  • Instruct the user that they can run the Sync main workflow but must check the force_override checkbox in the GitHub UI.
  • Or trigger it automatically via GitHub CLI with the bypass flag:
    gh workflow run sync-main.yml --ref dev -f force_override=true

Hard Case Workflow

If there are changes in the packages/ directory, do not execute any git commands automatically. You must stop and interview the user in the chat to align on how to proceed.

The Interview

Present the user with a clear summary of the unreleased package files that were detected, outline their choices, and make a recommendation based on the situation:

  1. Option 1: Wait for Release
    • Keep the doc changes on dev and let them deploy naturally on the next package release.
    • Recommendation: Use this if the doc fix is not urgent.
  2. Option 2: Run a Patch Release
    • Release a patch version of the packages (pnpm changeset -> trigger release workflow).
    • Recommendation: Use this if the doc fix is urgent, and the unreleased library code on dev is stable and ready to go live.
  3. Option 3: Cherry-Pick/Rescue
    • Cherry-pick only the doc commits onto main (if the doc fixes are isolated in their own clean commits).
    • Recommendation: Use this if the doc fix is urgent, the library code on dev cannot be released, AND the doc commits do not contain unreleased code.
  4. Option 4: Manual Recreation (Tangled Commits)
    • If the urgent doc fix is bundled in the exact same commit as unreleased package code, do not cherry-pick. Instead, manually recreate the doc fix directly against main using your code editing tools.
    • Recommendation: Use this if the doc fix is urgent but the commits are hopelessly tangled with unreleased code.

Executing Option 3 (Cherry-Pick / Rescue)

If the user explicitly approves Option 3, follow these steps using the helper script:

  1. Identify Commit Hashes: Locate the specific commit hashes on dev containing the doc changes.
  2. Run Rescue Script: Execute the helper script to cherry-pick these commits onto a branch from origin/main:
    ./scripts/sync-main.sh rescue <commit-hash-1> [commit-hash-2 ...]
  3. Submit PR: The script will attempt to create a PR to main via gh CLI. If it fails, help the user open the PR manually.
  4. Deploy: Once the PR is merged to main, the v0 archive (https://arkenv-v0.vercel.app) refreshes. Production / arkenv.js.org is unchanged (tracks v1).
  5. Reconcile: Merge main back into dev to prevent drift:
    ./scripts/sync-main.sh reconcile
    If conflicts occur during reconciliation, prompt the user to help resolve them, commit, and push dev.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.