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 <noreply@anthropic.com>
This commit is contained in:
@@ -327,6 +327,109 @@ Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user