# Sync Specs

Use when code changes may have made documentation outdated, when reviewing docs for...

- Repository: https://github.com/nexu-io/nexu (3280 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-04-26
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add nexu-io/nexu --skill sync-specs -g -a claude-code -y`
Codex: `npx skills add nexu-io/nexu --skill sync-specs -g -a codex -y`
Cursor: `npx skills add nexu-io/nexu --skill sync-specs -g -a cursor -y`
Gemini CLI: `npx skills add nexu-io/nexu --skill sync-specs -g -a gemini-cli -y`

## Description

Use when code changes may have made documentation outdated, when reviewing docs for consistency, or when the user asks to sync or audit documentation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Documentation Sync

Review code changes and update project documentation for consistency.

## Mode

| Mode | How to activate | Behavior |
|------|----------------|----------|
| `delta` (default) | No argument, or say "delta" | Diff against merge-base with `origin/main` + working tree changes |
| `full` | Say "full audit" or "full sync" | Complete audit of all docs against current codebase |
| Scope keyword | Say the keyword (e.g. "db", "api") | Targeted check (see Scope Filters below) |

## Delta Mode Baseline

Identify changed files using merge-base (not a fixed commit count):

```bash
# Branch changes since diverging from main
git diff --name-only $(git merge-base HEAD origin/main)...HEAD
# Plus staged + unstaged
git diff --name-only --cached
git diff --name-only
```

Combine the results into a single list of changed files. Then use the Impact Mapping to identify which docs may need updates.

## Impact Mapping

Map changed areas to the docs they affect:

| Changed area | Affected docs |
|---|---|
| `apps/controller/src/routes/` | `specs/references/api-patterns.md`, `ARCHITECTURE.md`, `specs/product-specs/*.md` (if route is user-facing) |
| `apps/web/src/pages/` or `apps/web/src/app.tsx` | `specs/FRONTEND.md` |
| `apps/landing/` | `ARCHITECTURE.md` (Monorepo layout) |
| `apps/controller/src/runtime/` | `ARCHITECTURE.md`, `specs/RELIABILITY.md` |
| `packages/shared/src/schemas/` | `ARCHITECTURE.md` (Type safety) |
| `package.json` scripts | `CLAUDE.md` + `AGENTS.md` Commands sections |
| New apps/packages dirs | `ARCHITECTURE.md` (Monorepo layout) |
| Config generator | `specs/references/openclaw-config-schema.md`, `specs/openclaw-config-reference.md` |
| Auth changes | `specs/SECURITY.md` |
| New/moved doc files | `CLAUDE.md` Doc Map, `AGENTS.md` Where to look, relevant index files |

## Cross-Reference Pairs

Always verify consistency between these paired docs:

The rest: https://github.com/nexu-io/nexu/blob/HEAD/skills/localdev/sync-specs/SKILL.md
