From 1452361c219af1b512879826aba9780ab9c608bf Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 15 Jan 2026 18:57:40 -0700 Subject: [PATCH] Update Gitea Agent: Add sync operation documentation Added comprehensive sync_from_remote operation: - Pull latest configuration from Gitea - Auto-stash local changes if needed - Handle merge conflicts gracefully - Report what changed Supports /sync command functionality. Co-authored-by: Claude Sonnet 4.5 --- .claude/agents/gitea.md | 103 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/.claude/agents/gitea.md b/.claude/agents/gitea.md index ebde86b..10fca3f 100644 --- a/.claude/agents/gitea.md +++ b/.claude/agents/gitea.md @@ -327,6 +327,109 @@ Co-authored-by: Claude Sonnet 4.5 " git push origin main ``` +## Sync from Remote (Pull Latest Configuration) + +### Sync Operation + +**Purpose:** Pull latest configuration, agents, and workflows from Gitea + +**Process:** +```bash +cd D:\ClaudeTools + +# 1. Fetch latest from remote +git fetch origin main + +# 2. Check local status +git status + +# 3. If clean, pull directly +if [[ -z $(git status --porcelain) ]]; then + git pull origin main +else + # 4. If dirty, stash local changes + git stash save "Auto-stash before sync - $(date +%Y-%m-%d-%H%M%S)" + git pull origin main + # Try to restore stashed changes + git stash pop || echo "Conflicts detected - manual resolution required" +fi + +# 5. Report what changed +git log HEAD@{1}..HEAD --oneline +``` + +**When Called:** +- User invokes `/sync` command +- User requests "sync settings" or "pull from Gitea" +- Periodic checks (weekly recommended) +- After repository updates + +### Sync Request + +```json +{ + "operation": "sync_from_remote", + "repository": "azcomputerguru/claudetools", + "base_path": "D:/ClaudeTools/", + "branch": "main", + "handle_conflicts": "auto-stash" +} +``` + +### Sync Response + +```json +{ + "success": true, + "operation": "sync_from_remote", + "files_updated": [ + ".claude/agents/coding.md", + ".claude/CODE_WORKFLOW.md", + "README.md" + ], + "files_count": 3, + "conflicts": false, + "local_changes_stashed": false, + "stash_id": null, + "commit_before": "fffb71f", + "commit_after": "a3f5b92c", + "commits_pulled": [ + { + "hash": "a3f5b92c", + "message": "Update coding agent standards", + "author": "Mike Swanson", + "date": "2026-01-15T15:30:00Z" + } + ], + "sync_timestamp": "2026-01-15T15:35:00Z" +} +``` + +### Sync with Conflicts Response + +```json +{ + "success": false, + "operation": "sync_from_remote", + "error": "merge_conflict", + "conflicted_files": [ + ".claude/agents/coding.md" + ], + "local_changes_stashed": true, + "stash_id": "stash@{0}", + "message": "Manual conflict resolution required", + "resolution_steps": [ + "Open .claude/agents/coding.md", + "Resolve conflict markers (<<<<<<, ======, >>>>>>)", + "Run: git add .claude/agents/coding.md", + "Run: git stash drop stash@{0}", + "Or ask Claude to help resolve the conflict" + ] +} +``` + +--- + ## Request/Response Format ### Commit Request (from Orchestrator)