跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

code-sync

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.

awrshift · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

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

技能说明


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, Edit, Grep, Glob, Bash

/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:
TierEvidence a done needs
prototypethe 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 specParent specOwed decisionAuthorized byAge

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

阅读完整来源 ↗