Skip to main content
skill CX Codex

code-sync — Claude Code skill: what it does, how to install

Reconciles project specifications and backlog records with actual repository code after merges, updating statuses only on hard evidence.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add awrshift/agent-memory-kit --skill code-sync -a claude-code
Open on GitHub

What code-sync does

The skill inspects projects/*/README.md or the documentation map declared in the root CLAUDE.md. For every spec inside plans/*.md marked as building, it verifies acceptance criteria by inspecting QA run files, checking tests, and executing gate commands directly from the repository root. If source code contradicts the spec via missing files or altered signatures, it marks the document as stale with an exact file reference.

Overridden items marked as assumed are gathered into an agenda table for review rather than modified automatically. In BACKLOG.md, tasks shift to Done only after all acceptance checkboxes are ticked and the parent spec reaches done. Without existing project documentation on disk, the skill halts immediately because it refuses to scaffold missing folders. Passing --dry-run outputs the planned diff without modifying any files.

What it helps with

  • reconcile project plans with repository changes after merging a branch
  • detect outdated specifications broken by renamed functions or deleted files
  • assemble unconfirmed architectural assumptions into a review agenda
  • transfer verified tasks to the finished section in BACKLOG.md

Example prompts for the agent

  • /memory-kit:code-sync
  • sync specs with code
  • /memory-kit:code-sync --dry-run

How to install code-sync

1Skills CLI (Vercel)

npx skills add awrshift/agent-memory-kit --skill code-sync -a claude-code

2Manually: put the files in place

~/.claude/skills/code-sync/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/code-sync/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about code-sync

How to install code-sync in Claude Code?

Run npx skills add awrshift/agent-memory-kit --skill code-sync -a claude-code.

What does code-sync do?

It checks project documentation against current code, executing test gates to validate acceptance criteria. Based on real execution results, it marks specs as done or flags broken ones as stale.

What happens if doc files are missing?

If it cannot locate projects/*/README.md or a map in the root README, the skill halts without scaffolding any directories.

Source text

SKILL.md · MIT
---
name: code-sync
description: >
  Reconcile the project's documents with what the code now shows, after a merge or at the end of
  a build: spec statuses (building → done only with a named gate, or → stale with the reason),
  assumed specs owed ratification, the project README map and its Last verified date. Surgical
  edits only. Use when the user says "/memory-kit:code-sync", "sync the docs", "sync specs with
  code", "синхронизируй доки с кодом", "что устарело в спеках", or right after merging an
  executor branch.
allowed-tools: Read, Grep, Glob, Edit(projects/**)
---

# /code-sync — documents reconciled against the repository

`close-session` reconciles the SESSION with memory. This reconciles a PROJECT's documents with
the CODE: every claim a spec still makes is checked against what is in the tree right now.

Two rails hold the whole skill up. **Evidence, never a claim** — a spec becomes `done` only from
a gate YOU ran in this session or a `Verified` cell someone already filled. **Surgical edits
only** — the only things you write are a status value, a `Verified` cell, one `Stale since:`
line, a map row, `Last verified:`, and a BACKLOG Done line. Everything else keeps its bytes.

## Step 0 — locate the projects

- `Glob projects/*/README.md`. If the repo keeps its documents elsewhere, read the root
  `CLAUDE.md` / `README.md` for the docs home and use the map it names. Nothing found → say so
  and stop. This skill never scaffolds.
- From each project README read two things: the map table ("Where this project's documents
  live") — the SSOT for where plans, QA records and the backlog actually are — and the
  `**Workflow tier:**` line, which sets how much evidence a `done` needs:

| Tier | Evidence a `done` needs |
|---|---|
| `prototype` | the gate output, run by you |
| `alpha` | + an integrator acceptance walk named in the `Verified` cell |
| `beta` | + a `qa/qa-run-*.md` record and tests naming each `AC-n` |
| `ga` | + a review pass and a `document` entry for the change |

- The user named one project → sweep only that one. Otherwise sweep all of them.

## Step 1 — inventory the specs

Read the header of every `plans/*.md` (`**Created:** YYYY-MM-DD · **Status:** …`; one grep over
the folder is enough). A plain `Status: …` line counts too, and a spec with no `Created:` takes its
date from a `YYYY-MM-DD-<slug>.md` file name — the SessionStart spec flags read them the same way.
A spec with no status line at all is counted as `no status` in the table, never guessed. Statuses are `draft · decided · building · done · superseded · assumed ·
stale`. Build the working table: spec · status · created · age in days.

`building` goes to step 2, `assumed` to step 3. `draft`, `decided`, `done`, `superseded` and
`stale` are counted and left untouched.

## Step 2 — every `building` spec against the code

Read its Acceptance table and its `## Gates` block in full. For each `AC-n` row hunt evidence in
this order and stop at the first that holds:

1. the row's `Verified` cell is already filled (date + pointer) → taken as is;
2. a QA run record naming the id — `grep -l "AC-3" projects/<name>/qa/qa-run-*.md` — and it
   records a pass;
3. a test that names the id (grep the test tree for the id), in a suite the gate below runs;
4. **the gate**: run the commands from the spec's `## Gates` block yourself, from the repo root,
   and read the output. A gate you did not run is not evidence.

Report per AC: evidence found (what · where) or missing. Then exactly one of:

- **All ACs have evidence** → set the status line to `done` and fill each `Verified` cell you
  earned with `YYYY-MM-DD · <the command you ran, or the record>`. Cells already filled stay as
  they are.
- **The code contradicts the spec** → check the spec's Slices "Files it owns" and the interfaces
  it names: `Glob`/`Grep` each one. A named file gone, a symbol renamed, a signature the spec
  depends on changed → set the status to `stale` and append, directly under the status line, one
  line: `**Stale since:** YYYY-MM-DD — <reason, file:line>`. A `stale` spec is never also `done`.
- **Anything else** → leave `building` exactly as it is and name what is missing: which `AC-n`,
  and what evidence would settle it. Half-evidence is not a flip.

## Step 3 — `assumed` specs owed ratification

An `assumed` spec is an executor's recorded override, not a decision. List every one of them:

| Assumed spec | Parent spec | Owed decision | Authorized by | Age |
|---|---|---|---|---|

Take Owed decision from the file's `## Owed decision` section, one line, and the authorizer from
its header. Print the table under the heading **Owed ratification** and recommend which to take
first (the oldest, or the one whose Code area the current work touches).

**Never flip or edit an `assumed` spec yourself.** The kit has no architect skill: the main
session deliberates, then either writes the real spec and marks the assumed one `superseded`, or
confirms the assumption and flips it to `decided`. Your output is that agenda, nothing more.

## Step 4 — BACKLOG.md, only what you can prove

A task moves to `## Done` only when BOTH hold: its `**Spec:**` points at a spec you flipped to
`done` in step 2, AND every box in its Acceptance list is already ticked. Then move it as one
line, newest first, in the file's own format:

```
- [YYYY-MM-DD] T-NNN — <its one line> · verified by `<the gate you ran>`
```

Everything else in that file — priorities, ordering, wording, `TODO` / `IN PROGRESS` / `BLOCKED`
statuses — is untouched. Never tick an acceptance box yourself: an unticked box is the
integrator's open question, not your paperwork.

## Step 5 — the README map and `Last verified`

For every document class that now has files on disk but no row in the map table, add the row
(Class · Path · Written by), using the classes the project template already names: Tasks ·
Plans / specs · Research + evidence · Decisions ledger · Review-finding classes · QA protocol +
runs · Client materials. An empty folder is not a row. A row that points at the wrong place is
the integrator's call — report the mismatch, don't repoint it. Then set `**Last verified:**` to
today. Nothing else in the README changes.

## Step 6 — report

Four lines, the kit's shape:

- **Headline:** `N specs reconciled: a done · b stale · c still building · d assumed owed`.
- **Next:** the ONE command or decision that moves this forward — the gate that would close the
  nearest `building` spec, or the assumed spec to ratify first.
- **Heads up:** only if a spec went `stale` — one line each, spec + reason.
- **Pointer:** the files you edited, as paths.

## Dry run

With the argument `--dry-run` — or when the user says "just show me" / "покажи, не трогай" — do
the whole walk and run the gates (reading is not writing), but print the plan of edits as a
table (file · line · from → to) instead of applying it. Nothing is written, not even
`Last verified:`. Close with the same four-line report plus the command to run it for real.

## What NOT to do

- **Never rewrite prose or a whole section.** The six writable things are listed at the top; if
  a fix needs anything else, report it instead of doing it.
- **Never mark `done` from a claim** — not an executor's report, not a subagent's summary, not
  "the tests should pass". Run the gate yourself (`reference/orchestrator-fact-check.md`).
- **Never flip or edit an `assumed` spec.** You list it; the integrator decides.
- **Never touch** `.claude/memory/MEMORY.md`, `context/handoffs/`, `knowledge/` or
  `.claude/rules/` — promotion lives in `/memory-kit:close-session`, on the user's yes.
- **Never create a file.** This skill creates none: no spec, no run record, no report file.
- **Never delete a document.** `superseded` and `stale` are labels, not removals
  (`reference/doc-governance.md`, R3).
- **Don't touch** a `draft`, `decided`, `done` or `superseded` spec at all — they are not yours
  to reconcile.

© awrshift · MIT · awrshift/agent-memory-kit

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set10

system-audit Runs a periodic check of the whole agent system against real files and command output: what works, what drifted, what to delete. Built for repos whose rules and memory have piled up. CX Codex +1 ★ 34repo stars setup Scaffolds Agent Memory Kit layers inside a repository, configures safe permission rails, and manages coexistence with Claude Code native auto memory. CX Codex +1 ★ 34repo stars session-review Review a substantial coding session with independent reviewers, then turn their findings into immediate fixes or a measurable follow-up plan. CX Codex +1 ★ 34repo stars second-opinion This skill sends the agent's own answer through independent reviewers before you ever see it. Useful for architecture calls and picking between options. CX Codex +1 ★ 34repo stars qa-sweep Runs a multi-lens agent QA sweep across a running product, verifies findings, and logs backlog tickets with run records. CX Codex +1 ★ 34repo stars memory-audit Reviews MEMORY.md, spots stale or duplicated entries, and prepares a change plan. Use it when the memory cache has crossed its limit. CX Codex +1 ★ 34repo stars document Turns a change into prose a human reads — a PR body, changelog entry, release note or postmortem — and files it in the right place. Drafts come only from git diff and git log. CX Codex +1 ★ 34repo stars close-session This skill reviews a work session, updates project memory, and prepares a handoff. Run it when you’re wrapping up and want the next session to know where to pick up. CX Codex +1 ★ 34repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor