agentleFS
freskhufreskhu/genesis/.claude/skills/sync-upstream/SKILL.md

sync-upstream

Skill5 starsChanged 6 months agoApache-2.0View on GitHub

Check the Genesis upstream repo (freskhu/genesis) for new commits, classify each one (additive / breaking / cosmetic), recommend whether to apply, and merge only with user confirmation. Run daily if the user opted in during /genesis.

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use start-mission, tdd and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • parkchuSkill

    start-mission

    넥스트스텝(NextStep) 미션을 처음 시작할 때, 미션 저장소를 fork·clone하고 최초 작업 브랜치(step1 등)까지 만들어 준다. gh CLI로 fork하고 clone까지 이어서 처리하며, gh가 없거나 인증이 안 돼 있으면 브라우저 Fork 안내로 폴백한다. 이미 fork/clone돼 있으면 재사용하고 이어서 진행한다(재실행 안전). 사용자가 "미션 시작하려는데 저장소 세팅해줘", "새 미션 시작할래", "fork부터 해줘", "/nextstep:start-mission" 등으로 요청할 때 사용한다.

    Also in 3 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 4 projects that use this

  • GoogleSkill

    improve-codebase-architecture

    Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check git is set up and there's an upstream remote pointing at freskhu/genesis.

    line 14
  2. Very specific:

    Read Database/genesis_config.json to get last_synced_commit.

    line 19
  3. Very specific:

    If NEW_COMMITS is empty — tell the user "Already up to date." and exit.

    line 31
  4. Distinctive:

    Ask the user one of:

    line 81
  5. Distinctive:

    When the user confirms applies:

    line 88
  6. Very specific:

    Don't pretend to understand a commit you couldn't classify: When in doubt, tag [UNCLEAR] and ask the user.

    line 128
  7. Distinctive:

    If the user prefers raw git, point them to:

    line 135

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “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 upstream

This skill keeps a forked Genesis in step with freskhu/genesis without surprising the user. It never auto-merges. It always shows what changed and waits for explicit confirmation.


Step 0 — Pre-flight

  1. Check git is set up and there's an upstream remote pointing at freskhu/genesis. If not, add it:
    git remote get-url upstream 2>/dev/null || \
      git remote add upstream https://github.com/freskhu/genesis.git
  2. Read Database/genesis_config.json to get last_synced_commit. If file doesn't exist, create with current HEAD SHA and a fresh-install timestamp.
  3. Confirm working tree is clean. If dirty, abort and tell the user to commit or stash first.

Step 1 — Fetch and diff

git fetch upstream main
NEW_COMMITS=$(git log "${LAST_SYNCED_COMMIT}..upstream/main" --oneline)

If NEW_COMMITS is empty — tell the user "Already up to date." and exit.

Otherwise, count how many new commits and which paths changed:

git log "${LAST_SYNCED_COMMIT}..upstream/main" --pretty=format:"%h|%s" --name-status

Step 2 — Classify each commit

For each commit, read the diff and classify into one of three buckets:

ClassHeuristicDefault action
AdditiveNew skill file, new hook, new doc, new agent template — no existing file deleted or signature changedRECOMMEND APPLY
BreakingSchema migration, removed file, changed function signature, changed CLAUDE.md fundamentalsFLAG REVIEW — do not apply without explicit user OK
CosmeticTypo fixes, README copy edits, comment improvementsRECOMMEND APPLY

To detect:

  • Additive: git diff --name-status shows only A (added) lines in .claude/skills/, .claude/hooks/, docs/, Database/migrations/.
  • Breaking: M or D on CLAUDE.md, Database/schema.sql, scripts/palace.py, or any agent file the user has customised (check against the user's git log).
  • Cosmetic: changes to README.md, *.md in docs/, comments only (no code lines changed).

Step 3 — Build the report

Format as a table the user can scan in 30 seconds:

Genesis upstream — 4 new commits since 2026-05-08

  abc1234  Add /mine-conversations skill                       [ADDITIVE]   apply ✓
  def5678  Fix typo in docs/architecture.md                    [COSMETIC]   apply ✓
  ghi9012  Refactor palace.py: rename TEAM_DB → DB_PATH        [BREAKING]   review ⚠
  jkl3456  Add NOTICE clause about commercial use              [COSMETIC]   apply ✓

3 of 4 commits are recommended to apply. 1 needs your review.

For BREAKING commits: include a 3-line summary of WHY it's breaking. Example:

ghi9012 renames TEAM_DB to DB_PATH in scripts/palace.py. If you've forked palace.py or have skills referencing TEAM_DB, they'll fail. Recommend: review the diff, update your forks, then merge.


Step 4 — Confirm + apply

Ask the user one of:

  1. Apply all recommended (skip the breaking one) — applies the 3 additive/cosmetic, leaves the breaking commit unmerged with a TODO note.
  2. Apply everything (including breaking) — full merge.
  3. Apply nothing — only update last_synced_commit so we don't ask again about these specific commits.
  4. Show me a specific diff — git show {sha} for any commit.

When the user confirms applies:

# Cherry-pick the chosen commits in order, OR merge upstream/main if applying all
git merge upstream/main
# (or)
git cherry-pick {sha1} {sha2} {sha3}

Update genesis_config.json:

{
  "last_synced_commit": "{new_HEAD_SHA}",
  "last_sync_check": "2026-05-08T22:30:00Z",
  "auto_sync_enabled": true,
  "skipped_commits": ["ghi9012"]
}

Log to activity_history:

INSERT INTO activity_history (actor_id, action, entity_type, summary)
VALUES (1, 'upstream_synced', 'system',
        'Synced N commits from freskhu/genesis main. Skipped: {list}.');

Step 5 — If anything fails

  • Merge conflict: abort the merge, show the user the conflicting files, suggest /handoff to package the state for a clean resolution session.
  • Network / GitHub down: save state, retry on next run.
  • Upstream removed a file the user customised: flag prominently, never silently delete.

Anti-patterns

  • Never auto-apply breaking commits. Even if the user said "yes apply all" once, breaking commits always re-confirm.
  • Never overwrite user-customised files without showing the diff.
  • Don't pretend to understand a commit you couldn't classify. When in doubt, tag [UNCLEAR] and ask the user.
  • Don't run more than once a day unless the user explicitly asks. Daily is enough; chasing every commit is noise.

Quick CLI for power users

If the user prefers raw git, point them to:

git fetch upstream main
git log HEAD..upstream/main --oneline
git diff HEAD upstream/main -- path/of/interest
git merge upstream/main          # take everything
git cherry-pick <sha>            # take one commit

The skill exists so users don't have to — but advanced users can drive it themselves.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.