Skip to content
Back to skills

Update Cog

ASecurity

Check for and apply upstream COG framework updates (skills, docs, scripts) without touching personal content

  • 1,559 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 26, 2026
devopsshellbashgitdocumentation

Works with

  • cursor

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add huytieu/COG-second-brain --skill update-cog --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Update Cog?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Update Cog
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/huytieu-update-cog/badge)](https://www.skillsdirectory.com/skills/huytieu-update-cog)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: update-cog
description: Check for and apply upstream COG framework updates (skills, docs, scripts) without touching personal content
roles: [all]
integrations: [git]
---

# COG Update Skill

## Purpose
Help the user update their COG framework files (skills, documentation, scripts) from the official upstream repository without risking their personal content (braindumps, profiles, notes).

## When to Invoke
- User asks to "update COG", "check for updates", or "get latest COG version"
- User mentions wanting new skills or features from upstream
- User asks about their COG version

## Process Flow

### 1. Check Current Version
Read `COG-VERSION` from the repository root. If it doesn't exist, inform the user they may be on an older version that predates version tracking.

### 2. Ensure Upstream Remote
```bash
# Add the upstream remote if not already present
git remote get-url cog-upstream 2>/dev/null || \
  git remote add cog-upstream https://github.com/huytieu/COG-second-brain.git

# Fetch latest
git fetch cog-upstream main --quiet
```

### 3. Compare Versions
```bash
# Local version
cat COG-VERSION

# Upstream version
git show cog-upstream/main:COG-VERSION
```

If versions match, tell the user they're up to date.

### 4. Show What Changed
For each framework file, compare local vs upstream:
```bash
git diff HEAD..cog-upstream/main -- <file>
```

**Framework files** (safe to update; they never contain user content). The authoritative list is the `FRAMEWORK_FILES` array in `cog-update.sh`. The main groups are:
- Core docs: `README.md`, `SETUP.md`, `AGENTS.md`, `GEMINI.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `WORKFLOW.md`, `RESOLVER.md`, `BRAIN-HEALTHCHECK.md`, `BRAIN-MAINTENANCE.md`, and the files in `docs/`
- Skills: every file under `.claude/skills/` and `.agents/skills/`
- Agents and roles: `.claude/agents/`, `.agents/agents/`, `.claude/roles/`
- Helpers: `.claude/lib/`, `.claude/hooks/` (shipped, never installed into your settings), and `scripts/`
- Powers and commands: `.kiro/powers/*/POWER.md`, `.gemini/commands/*.toml`, `.gemini/skills/*.md`
- Manifests: `plugin.json`, `.claude-plugin/plugin.json`, `.cursor-plugin/plugin.json`, `marketplace-entry.json`, `.cursorrules`, `.gitignore`
- Version: `COG-VERSION`

### 5. Detect Customizations
Before updating, check if the user has customized any framework files:
```bash
# Show how the working tree differs from current upstream HEAD.
# NOTE: this cannot tell a local customization apart from an upstream
# change you have not pulled yet - both show up as a diff. Treat any
# output as "needs a look", not as proof the user edited the file.
git diff cog-upstream/main -- <file>
```

If a file differs, warn the user and offer options:
- **Keep yours**: Skip this file
- **Use upstream**: Overwrite with the new version
- **Backup + update**: Save current as `<file>.backup-YYYYMMDD` then update

### 6. Apply Updates
For files the user approves:
```bash
# Surgical file replacement - no merge, no rebase, zero conflict risk
git checkout cog-upstream/main -- <file>
```

### 7. Rebuild and Validate
After you apply updates, rebuild the plugin mirror and run the validator. Both scripts ship with COG:
```bash
./scripts/build-agent-plugin.sh
./scripts/validate-agent-surface.sh
```
The mirror in `skills/` is generated from `.claude/skills/`, so skip nothing here. If the validator reports a problem after an update, show it to the user and do not hide it. The update itself still stands. A missing script means the user's copy predates it: say so and continue.

### 8. Verify & Summarize
After updating:
- Show the new version number
- List all files that were updated
- List any files the user chose to skip
- Suggest committing the update:
  ```
  git add -A && git commit -m "Update COG framework to v<new-version>"
  ```

## Alternative: Shell Script
For users who prefer a non-AI update, mention the update script:
```bash
./cog-update.sh           # Interactive
./cog-update.sh --check   # Just check for updates
./cog-update.sh --dry-run # Preview changes
./cog-update.sh --force   # Update everything
```

## Important Notes
- **Content folders are NEVER touched** by the updater, with one exception: `05-knowledge/people/README.md` and `06-templates/people-profile-template.md` are framework files and are updated. `00-inbox/`, `01-daily/`, `02-personal/`, `03-professional/`, `04-projects/` and the rest of `05-knowledge/` and `06-templates/` hold user data
- **Your content is not in the update list.** Only the files in `FRAMEWORK_FILES` are compared with upstream. The repository tracks only `.gitkeep` files in the content folders, and `.gitignore` leaves them tracked by default (the lines that would ignore them are commented out, so you can opt in)
- **`cog.local.yaml` is never updated** - it holds the user's `vault_path` and is not a framework file
- **External vault** - if `vault_path` points outside the repository, never overwrite the vault copies of `05-knowledge/people/README.md` and `06-templates/people-profile-template.md`. Copy them from upstream into the vault only when they are missing there
- **The update script updates itself** - `cog-update.sh` is in the framework file list. A local version older than 3.17.0 cannot restart itself, so the first run installs only the files that old script knows about. When the local version is 3.16.1 or earlier, run `./cog-update.sh` a second time to get the new skills, scripts, hooks and root docs, and ignore one syntax-error or `command not found` line at the end of the first run. Answer the prompts on that first run instead of using `--force`
- **A linked vault folder is skipped, not an error** - when `05-knowledge` or `06-templates` is a symlink, the updater leaves the two People CRM files in it alone and prints a warning. Set `vault_path` in `cog.local.yaml` to manage them
- **No merge conflicts possible** - this uses `git checkout` for surgical file replacement, not `git merge` or `git rebase`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.