# Auto Update

> Automatically checks the Git repository for updates to the agents' skills, instructions, or code (max 1 check per day when orchestrator is invoked), and applies updates to keep the ecosystem synchronized without running annoying background daemons.

- Skill: `lensetek/auto-update` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lensetek/auto-update`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lensetek/auto-update/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: lensetek (https://skillmd.com/u/lensetek)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lensetek/auto-update

---


# Auto Update Skill

You are equipped with the **Auto Update Skill**. This skill ensures that your workspace, including your own instructions and the definitions of all sub-agents and modular skills, remains up-to-date with the remote repository.

## Throttling Rules (1 Check per Day Max)
- **Do NOT run background polling daemons.**
- When the Central Orchestrator (`spmi-mcp-agent` / `SkillForge Orchestrator`) is invoked, check the timestamp file `.agents/last_update_check.json`.
- If the timestamp indicates a check was already completed today (YYYY-MM-DD), **SKIP** the remote `git fetch` operation to prevent repetitive network requests and prompt fatigue.
- If today's check has not been performed yet, execute the check, log the update status, and write today's date into `.agents/last_update_check.json`.

## Objectives
- Check for updates on the remote repository automatically max once a day during orchestrator startup.
- Review commit messages or changelogs before applying changes.
- Safely pull changes without overwriting local configurations or unsaved work.
- Provide error handling for authentication or repository locking issues.

## Workflow & Actions

### 1. Daily Throttled Check
1. Read `.agents/last_update_check.json`.
2. Check if `last_check_date` === `YYYY-MM-DD` (today's date).
   - If **TRUE**: Skip check silently.
   - If **FALSE**: Proceed to step 2 and write today's date to `.agents/last_update_check.json`.

### 2. Check for Remote Updates
1. Try executing `git fetch origin` to retrieve the latest state from the remote repository.
   - **Error Handling:** If git is not installed, the repository is not configured, or authentication fails, log a descriptive warning (e.g., *"Cannot fetch remote changes. Please check internet connection or Git configuration"*).
2. Run `git status -uno` to check if the local branch is behind the remote tracking branch.
3. Run `git log HEAD..origin/main --oneline` (if behind) to retrieve a list of new changes.

### 3. Identify "What's New" & Prompt
- Extract the latest list of changes from commit messages or `README.md`.
- Inform the user if new updates exist.

### 4. Safely Pull Changes
1. Ensure there are no uncommitted local changes that would be overwritten by checking `git status`.
2. Execute `git pull origin main` (or active branch name) upon user approval.
3. Reload workspace skills to activate changes immediately.

