Agent skill

code-sync

Use this skill to batch-sync all git repos across machines — pushing uncommitted changes at end of day or pulling latest at start of day. Invoke when the user wants to sync all repos (not just one), mentions 「下班同步」「上班更新」 「code-sync」, or describes end-of-day push / morning pull across ~/code. Triggers on: "sync all my repos", "end of day sync", "morning update", "push all dirty repos", "pull all projects", 「同步代码」「下班同步」「上班更新」. Do NOT trigger for: single-repo git operations, committing specific files (use git-workflow), general git push/pull questions, or workspace template updates.

Stars 10
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/niracler/skill/tree/main/skills/workflow/code-sync

Metadata

Additional technical details for this skill

openclaw
{
    "emoji": "\ud83d\udd04",
    "requires": {
        "bins": [
            "git"
        ]
    }
}

SKILL.md

Code Sync

Batch sync all git repos under a base directory — push (end-of-day) or pull (start-of-day). Default base directory: ~/code. Configurable via ~/.config/nini-skill/code-sync/config.md.

Prerequisites

Tool Type Required Install
git cli Yes brew install git or git-scm.com
git-workflow skill Yes Included in npx skills add niracler/skillmust be invoked via Skill tool for all commits

Do NOT proactively verify these tools on skill load. If a command fails due to a missing tool, directly guide the user through installation and configuration step by step.

First-Time Setup

On first use, check for config at ~/.config/nini-skill/code-sync/config.md. If not found, ask the user:

  1. "Where do you keep your git repos?" (default: ~/code)
  2. "What's the directory structure?" — explain the expected pattern: <base-dir>/*/ for top-level repos and <base-dir>/*/repos/*/ for monorepo sub-repos
  3. Save to ~/.config/nini-skill/code-sync/config.md:
yaml
base_dir: ~/code

Mode Selection

User says Mode
「下班同步」or "push" Push
「上班更新」or "pull" Pull
「同步代码」「code-sync」 Ask user

Workflow (shared by both modes)

  1. Scan → 2. Categorize → 3. Batch action (auto, no confirmation) → 4. Handle exceptions (interactive) → 5. Summary

If all repos are up-to-date, report that and stop.

Scan

bash
bash scripts/scan.sh                          # Push: local data only (default ~/code)
bash scripts/scan.sh --fetch                  # Pull: fetch remote first (10s timeout/repo)
bash scripts/scan.sh --base-dir /path/to/dir  # Custom base directory

Output: JSON array with fields path, name, branch, remote, remote_url, dirty_count, has_upstream, ahead, behind, and fetch_error (only on --fetch failure).

Categorize

Push mode:

Category Condition Action
up-to-date dirty_count == 0 && ahead == 0 Report
needs-push dirty_count == 0 && ahead > 0 Auto git push
dirty dirty_count > 0 Interactive
no-upstream has_upstream == false Ask user

Pull mode:

Category Condition Action
up-to-date dirty_count == 0 && behind == 0 Report
needs-pull dirty_count == 0 && behind > 0 Auto git pull --ff-only
dirty+behind dirty_count > 0 && behind > 0 Interactive
fetch-error fetch_error == true Report, skip

Exception Handling

Situation Steps
Dirty repo (push) git diff --stat + git status → describe to user → ask: commit, stash, or skip. If commit, MUST invoke git-workflow skill via Skill tool — never run git commit directly.
No upstream (push) Report → ask: set upstream and push (git push -u origin <branch>), or skip
ff-only fails (pull) git log --oneline HEAD..@{u} + @{u}..HEAD → explain divergence → suggest: rebase, merge, or skip
Dirty + behind (pull) Report both issues → ask: stash and pull (stash, pull --ff-only, pop), or skip

Summary

Group repos by outcome after all operations complete:

text
## {Push|Pull} Summary

{Pushed|Updated} (N):
  - repo-name (branch, N commits)
Already up-to-date (N):
  - repo-a, repo-b, ...
Resolved (N):
  - repo-c: action taken
Skipped (N):
  - repo-d: reason

Common Issues

Issue Fix
scan.sh finds 0 repos Check ~/code/*/ has git repos
fetch_error Check network, SSH keys
ff-only fails Rebase or merge manually
Push rejected Pull first, then push

Expand your agent's capabilities with these related and highly-rated skills.

niracler/skill

pinboard-manager

Use this skill for ALL Pinboard bookmark management tasks — this is the go-to skill whenever Pinboard (pinboard.in) is involved. Invoke immediately when the user wants to: audit or reorganize messy tags, check for broken/dead links, identify stale or outdated bookmarks, clean up their bookmark collection, or manage their Pinboard account in any way. Also use when the user says 整理书签, 检查死链, 整理 tag, 书签管理, pinboard cleanup, bookmark audit, tag consistency, timeliness check, pinboard 过时检测. Do NOT trigger for: browser bookmark management, Raindrop.io, or general URL checking without Pinboard context.

10 0
Explore
niracler/skill

yunxiao

Use this skill for all Alibaba Cloud 云效 (Yunxiao) DevOps operations on codeup.aliyun.com. Invoke IMMEDIATELY when the user wants to: create or manage Merge Requests (MR) on codeup, update work items/tasks in 云效, query MR lists or task status, create version tags via 云效 API, or push code to a codeup remote. Key triggers: 创建 MR, 提交评审, 云效, yunxiao, codeup, 更新任务, 查看任务, 发布版本, 打 tag. Handles both MCP tool mode and aliyun CLI fallback. Do NOT use for GitHub PRs (use git-workflow), Jira, GitLab, or non-Alibaba platforms.

10 0
Explore
niracler/skill

weekly-report

Use this skill whenever the user wants to write or generate a structured weekly work report (软件研发周报) — the formal 3-section corporate format with 本周工作总结, 下周工作计划, and 其他事项. This skill automatically collects data from git logs, Obsidian diary Work Log entries, schedule YAML files, GitHub PRs, and 云效 MRs/tasks to draft the report. Invoke when the user says 周报, 软件研发周报, 本周工作总结, 写周报, weekly report, end-of-week summary, or asks to prepare a work summary for their manager/team. Do NOT use for personal diary entries, monthly reviews, OKR summaries, meeting notes, or quarterly retrospectives.

10 0
Explore
niracler/skill

ha-integration-reviewer

Strict Home Assistant integration code review for PR preparation. Covers Quality Scale rules, code style, Config Flow, test coverage, and docs. Invoke immediately when the user says "review my HA integration", "check HA compliance", "HA code review", "HA Quality Scale check", "home assistant PR review", "审查我的 HA 集成", "检查我的代码是否符合 HA 规范", "帮我 review 一下准备提交的代码". Launches parallel check agents across 5 dimensions. Do NOT use for: non-HA code review, configuring HA automations, HACS plugins, or Lovelace card development.

10 0
Explore
niracler/skill

schedule-manager

(macOS only) Use this skill for ALL Apple Calendar and Reminders management tasks using osascript and reminders-cli, following GTD methodology. Invoke immediately when the user wants to: schedule a meeting or event, add a todo or reminder, check today's agenda, plan the week ahead, do a weekly review, or capture any task they don't want to forget. Also use when the user says 安排会议, 创建提醒, 查看日程, 规划下周, 添加待办, 记一下, 别忘了, 今天要做什么, 周回顾. This is the right skill any time the user wants to interact with macOS Calendar or Reminders apps.

10 0
Explore
niracler/skill

skill-reviewer

Use this skill to audit, review, or validate Claude Code skills (.md files in .claude/commands/). Invoke when user wants to check skill quality, cross-platform compatibility, cross-agent compatibility, prerequisite declarations, or description triggering accuracy. Triggers on: 审查 skill, review skill, 检查 skill 质量, skill 兼容性检查, validate skill, audit skill. This skill delegates structure validation to validate.sh, content quality to skill-creator, and handles compatibility auditing itself. Do NOT use for general code review, reviewing PRs, or reviewing CLAUDE.md.

10 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results