sync-core-repo-docs
Create or audit a repo's three core doc files — README.md, the agent instructions file (AGENTS.md or CLAUDE.md), and REVIEW.md — in that dependency order. If a file is missing, generate it from the codebase; if it exists, audit it against the current code and apply targeted fixes after confirmation. README.md gets a developer from clone to running the project; AGENTS.md captures coding guidance for the agent (delegating to /init or claude-md-improver); REVIEW.md holds guidance for code reviewers, human or automated, without duplicating AGENTS.md. Target files with --readme, --claude, and --review, or run all three. Use whenever the user wants to set up, bootstrap, scaffold, refresh, audit, update, or sync a repo's docs, or says things like "create a README", "is my README still accurate", "write a CLAUDE.md", "write an AGENTS.md", "audit our docs", or "get this repo ready for contributors" — even when only one file is named. Prefer it over claude-md-improver when README or REVIEW are also in scope.
- License 许可
- MIT
- 所属仓库
- esond/skills
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- sync-core-repo-docs
- description
- Create or audit a repo's three core doc files — README.md, the agent instructions file (AGENTS.md or CLAUDE.md), and REVIEW.md — in that dependency order. If a file is missing, generate it from the codebase; if it exists, audit it against the current code and apply targeted fixes after confirmation. README.md gets a developer from clone to running the project; AGENTS.md captures coding guidance for the agent (delegating to /init or claude-md-improver); REVIEW.md holds guidance for code reviewers, human or automated, without duplicating AGENTS.md. Target files with --readme, --claude, and --review, or run all three. Use whenever the user wants to set up, bootstrap, scaffold, refresh, audit, update, or sync a repo's docs, or says things like "create a README", "is my README still accurate", "write a CLAUDE.md", "write an AGENTS.md", "audit our docs", or "get this repo ready for contributors" — even when only one file is named. Prefer it over claude-md-improver when README or REVIEW are also in scope.
02 资源文件 3
- 参考文档agents/openai.yaml136 B
- 参考文档references/readme-guidance.md5.5 KB
- 参考文档references/review-guidance.md7.6 KB
03 SKILL.md 正文
sync-core-repo-docs
Create or audit the three documentation files that orient a developer (and a coding agent) to a repository:
- README.md — for humans. Gets a developer from a fresh clone to running the project — a debug build for an app, install-and-use for a library or tool.
- AGENTS.md — for the agent. Coding guidance and project context used while writing code.
- REVIEW.md — for reviewers. Guidance used while reviewing code, by humans or automated code review agents.
The instructions file is AGENTS.md, with CLAUDE.md as a symlink to it or a one-line @AGENTS.md import. A repo that has only a CLAUDE.md keeps it: audit and edit that file in place rather than introducing AGENTS.md. Everywhere below, "AGENTS.md" means whichever of the two the repo actually uses; --claude keeps its name and targets that file.
For each file: if it's missing, create it from the actual codebase; if it exists, audit it for accuracy and propose targeted fixes. Creating a file is a normal write; changing an existing file is gated behind a confirmation checkpoint, because the user may have written something deliberately that looks wrong from the outside.
Why this order
Always process the files in this sequence — README.md → AGENTS.md → REVIEW.md — because each settles facts the next one reuses:
- README.md first establishes the canonical one-line purpose, the build/test commands, and the architecture-in-brief — verified against the repo.
- AGENTS.md can then reuse those verified commands and that structure instead of rediscovering them, and must not contradict the README.
- REVIEW.md last must avoid duplicating AGENTS.md (see Step 3), so AGENTS.md has to be settled before REVIEW.md is written.
Finish one file — including its confirmation checkpoint — before starting the next. That way later files build on the approved version of earlier ones, not a draft.
Selecting targets
Flags choose which files to process:
Flags combine (--readme --review does both). With no flags, process all three. Whatever the subset, always run it in the canonical order above — flag order on the command line is irrelevant.
The shared rhythm for every file
Each step below is one of two paths, decided by whether the file already exists at the repo root:
Create path (file absent):
- Gather what the file needs by reading the repo (not by guessing).
- Write the file.
- Show the user what you created and why it's shaped that way.
Audit path (file present):
- Read the existing file.
- Cross-reference every concrete claim against the current codebase — commands, paths, versions, prerequisites, architecture. A doc is wrong the moment the code moves underneath it; staleness is the default failure mode, so verify rather than trust.
- Produce a findings report: what's accurate, what's stale/broken/missing, and the specific fix for each problem.
- Stop and ask for confirmation before editing. The user may have written something intentionally that looks off, or may want to fix it themselves.
- On approval, apply targeted edits with
Edit— change only what's inaccurate.
Read the relevant reference file before doing a README or REVIEW step; they hold the structure and the audit lens for each.
Step 1 — README.md
Read references/readme-guidance.md first. The README's job is orientation — a newcomer should come away understanding what the project is and how to get it running (a debug build for an app; install-and-use for a library or tool). Judge it by whether the information needed for orientation is present, accurate, and findable — not by whether it follows a particular structure. The guidance file holds the orientation checklist and how create and audit differ.
Create: Inspect the repo to learn what a newcomer actually needs — language/runtime and version, package manager, build/test/run commands (from package.json, *.csproj/build scripts, Makefile, pyproject.toml, etc.), required tooling, environment/config, and whether any deeper docs exist to link. Then write a README that covers the orientation checklist, arranged however suits the repo, including only the items that apply (don't invent a docs or configuration section the repo has no use for).
Audit: Verify the existing README against the repo — do the documented prerequisites, setup steps, and commands still work and match reality, and do referenced docs/paths still exist? Surface anything stale, broken, or misleading that would leave a newcomer stuck. A missing optional section is not automatically a defect — judge gaps by whether they actually impair orientation. Do not restructure or reformat an existing README — match its existing structure and only fix accuracy. Larger formatting changes are out of scope unless the user asks.
Step 2 — AGENTS.md
AGENTS.md is the agent's working context: build/test commands, architecture, conventions, and non-obvious gotchas — concise, project-specific, every line earning its place. Reuse the facts settled in Step 1 (purpose, commands, structure) rather than rediscovering them.
Create (file absent): Analyze the codebase and write a fresh AGENTS.md — replicating what Claude Code's /init would do (this is descriptive, not an instruction to invoke the slash command). If the claude-md-improver skill (from the claude-md-management plugin) is installed, you may hand off to it after creation to refine the result. Keep it concise and actionable: commands that copy-paste cleanly, real paths, a brief architecture map, and the gotchas a new session would otherwise stumble on. Skip generic best-practice advice — it isn't project-specific and wastes the context window.
Audit (file present): Do what the claude-md-improver skill does. If that skill is installed, invoke it. If it isn't, follow its workflow inline: score the file (commands, architecture clarity, non-obvious patterns, conciseness, currency, actionability), output a quality report, stop for confirmation, then apply targeted additions/fixes — flagging stale commands, deleted-file references, outdated tech versions, and undocumented gotchas. Don't pad the file with obvious or generic content.
Either way, this step keeps the skill's standard rhythm: for an existing file, report → confirm → apply.
Step 3 — REVIEW.md
Read references/review-guidance.md first. REVIEW.md is reviewer-facing guidance for whoever reviews a change — a human or an automated code review agent: what to scrutinize in this codebase, security-sensitive surfaces, invariants that must hold, and known false-positive patterns reviewers should not flag.
The defining constraint: REVIEW.md must not duplicate AGENTS.md. They serve different moments — AGENTS.md guides writing code, REVIEW.md guides reviewing it. Before writing or accepting any REVIEW.md content, check it against the AGENTS.md settled in Step 2 and drop anything already covered there. If --review ran alone and Step 2 didn't execute this session, read the existing AGENTS.md from disk to perform this check. The guidance file explains how to keep the two cleanly separated.
Create: Derive review priorities from the codebase — trust boundaries, auth/crypto/input-handling code, concurrency, money/units math, and other places where a subtle change does real damage — and write REVIEW.md per the recommended structure.
Audit: Verify the existing REVIEW.md still matches the code (do the referenced risk areas and files still exist?) and, critically, check for overlap that has crept in against the current AGENTS.md. Report → confirm → apply.
Things not to do
- Don't edit an existing file without showing findings and getting confirmation first. Creating a missing file is fine to do directly; rewriting something the user wrote is not.
- Don't restructure or reformat an existing README. Audit for accuracy and match the structure that's there.
- Don't process the files out of order. README → AGENTS → REVIEW exists so each builds on the approved version of the last.
- Don't let REVIEW.md and AGENTS.md say the same things. Overlap is the main way REVIEW.md goes wrong — when in doubt, leave authoring guidance in AGENTS.md and keep REVIEW.md about what to scrutinize.
- Don't invent commands, prerequisites, or architecture. Every concrete claim in any of these files must be verified against the repo — an unverified doc is worse than no doc.
- Don't pad AGENTS.md or REVIEW.md with generic best practices. Project-specific, non-obvious content only.
04 同仓库更多 Skills
work-item-voice
Write or edit the user's issues in their own voice, in any work tracker — Jira, Linear, GitHub Issues, Azure DevOps. Covers features (new behavior), tasks (work that needs doing), and bugs (behavior that does not match expectation). Load this whenever the deliverable is an issue body, whether they say "file a bug", "write a ticket", "draft a story", "create an issue for this", "turn this into a Jira", "write this up in Linear", or paste a thread and ask for an issue out of it. Load it too whenever text goes into an issue that already exists — "record this in the issue", "add what we found to the ticket", "note this on the card", "update the one about refunds", or naming an issue by its key and asking for a fact to go in it — and when writing or updating one is a step inside a larger task. Features get behavior-driven framing with no implementation prescribed, and bugs get expected versus actual. Not for a comment on an issue, which is a conversation turn.
conversational-voice
Write the user's side of a conversation with another person, in the user's own voice: Slack messages and replies, DMs, email, PR and code-review comments, Linear or Jira comments, and any other turn in an exchange that goes out under the user's name. Load this whenever the deliverable is a message a human will read as written by the user, whether they say "draft a Slack message", "reply to this", "how should I word this", "tell the team", "ask them about X", "send a note to", or just paste a thread and ask what to say back. Load it too when tightening, shortening, or sanity-checking a message they already wrote, and when a message is one step of a larger task. The register is direct and informal, the way they'd talk to a friend or acquaintance, with the answer up front for a reader who skims. Not for something the user authors rather than sends — an issue body, a PR description, a commit message — even though a person reads those too.
sync-core-docs
Create or audit a repo's README.md, AGENTS.md/CLAUDE.md, and REVIEW.md docs.
righting-software-system-design
Opt-in, collaborative system-design workflow based on Juval Löwy's iDesign methodology in *Righting Software*. Conducts a multi-phase interview (framing → use cases → volatility analysis → components → call-chain validation → report) that surfaces unknown-unknowns and produces a written recommendation at `decompositions/{system-name}/report.md`. **Run only when the user explicitly invites this workflow** — not for general architecture questions, lightweight design conversations, or quick "where should X live?" questions. Valid triggers: the user names the skill directly, references *Righting Software* / Juval Löwy / iDesign / "The Method" / volatility-based decomposition and asks to run a full session, asks for a "deep" or "structured" or "Löwy-style" system design session, or accepts a prior suggestion to run it. Wait for an explicit yes before entering Phase 0. The skill is interrogative — a back-and-forth interview that challenges each volatility candidate and proposes ones the user hasn't considered.
reorganize-branch-commits
Reorganize the commits on a non-default git branch into a clean, logical history by rewriting the branch — `git reset` + re-commit by default, `git rebase -i` when commit boundaries already align. Propose groupings based on the actual work done (features, refactors, tests, fixes, docs), get explicit user approval, back the branch up, then rewrite history. Use this skill whenever the user wants to tidy up, clean up, reorganize, restructure, squash, or curate commits on a feature branch — even if they phrase it as "my branch is a mess", "squash this down", "combine these commits", "fix up the commit log before I open a PR", or "make the commits presentable for review". Trigger proactively when the user is about to open or push a PR and the branch has scrappy/WIP/"fix" commits to collapse. Refuses to operate on default or release-shaped branches (main, master, develop, trunk, production, release, or the repo default) — a feature-branch-only tool.
pr-review-resolver
Address outstanding review feedback on a GitHub pull request: unresolved review threads, submitted review bodies, and general PR comments. Triages each critically, fixes what it agrees with, and pushes back on the rest. Use whenever the user wants to address, fix, resolve, or work through PR review comments or feedback, even if they just say "handle the PR comments", "fix what the reviewers said", or "go through the PR", or pastes a PR URL and asks you to act on the feedback there.