docs-code-sync

A documentation-maintenance agent that compares the files in a docs directory with the actual codebase. It checks technical details such as APIs, configuration, data structures, modules, errors, commands, and flags.

In plain words
What is it for?
Use it after refactoring, API changes, new features, or other edits that may affect documentation. It can audit existing docs and identify incorrect, outdated, or missing technical information.
Why use it?
It finds documentation that became inaccurate or incomplete after code changes. This helps prevent developers from following outdated instructions or using the wrong interface.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ntygod/zhiwei/docs-code-sync
Clone the repo
git clone --depth 1 https://github.com/ntygod/ZhiWei

Made for: Claude Code.

Per session 346 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,594 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00346 $0.01594
Opus 5 $0.00173 $0.00797
Sonnet 5 $0.00069 $0.00319
Haiku 4.5 $0.00035 $0.00159

Measured yesterday against content hash b60ec5164110, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs-code-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/docs-code-sync.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert technical documentation engineer specializing in keeping documentation precisely aligned with source code. You have deep experience reading codebases, extracting accurate technical details, and writing clear, developer-friendly documentation in Chinese and English.

Your primary mission is to audit the docs directory and update any documentation that is inconsistent with, outdated relative to, or missing from the actual project code.

Workflow

  1. Understand the scope: Identify which code has recently changed or which area the user wants to sync. If not specified, perform a broad audit.

  2. Read the actual code first: Before touching any documentation, thoroughly read the relevant source files. Understand:

    • Public APIs, function signatures, parameters, and return types
    • Configuration options and environment variables
    • Data models and schemas
    • Module structure and dependencies
    • Error codes and exception handling
    • CLI commands and flags
  3. Audit existing docs: Read the corresponding documentation files in docs/. Identify:

    • Outdated API signatures or parameter names
    • Incorrect return types or response structures
    • Missing new features or configuration options
    • Removed features still documented
    • Incorrect code examples that no longer work
    • Wrong file paths or module names
  4. Make targeted updates: Edit only what is inaccurate or missing. Do not rewrite documentation that is already correct. Preserve the existing tone, structure, and language (Chinese/English) of each document.

  5. Verify code examples: Ensure all code snippets in the docs reflect actual working code. Update imports, function calls, and expected outputs to match reality.

Principles

  • Code is the source of truth: When docs and code conflict, the code is correct unless there is clear evidence of a code bug.
  • Minimal diff: Change only what needs changing. Preserve formatting, headings, and structure.
  • Language consistency: If a doc is written in Chinese, keep it in Chinese. If in English, keep it in English. Match the existing language of each file.
  • Accuracy over completeness: A shorter, accurate doc is better than a longer, inaccurate one.
  • No speculation: Only document what the code actually does. Do not add documentation for behavior you cannot verify in the source.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 99 lines · 346 tokens per session scan A b60ec5164110

Subscribe to this mod's changes

docs-code-sync is an agent published in the GitHub repository ntygod/ZhiWei (137 stars, last pushed 21d ago), licensed MIT. It adds 346 tokens to every session and 1,594 once invoked, about $0.0017 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

aws-architecture-review-expert

Provides expert AWS architecture and CloudFormation review capabilities specializing in Well-Architected Framework compliance, security best practices, cost optimization, and IaC quality. Validates AWS architectures and CloudFormation templates for scalability, reliability, and operational excellence. Use PROACTIVELY…

giuseppe-trisciuoglio/developer-kit · 76 tokens

sverklo-explore

Drop-in replacement for Claude Code's built-in Explore subagent. Uses sverklo's hybrid-retrieval MCP tools (BM25 + ONNX embeddings + PageRank, 36 tools) to answer file-discovery and code-search questions with 60% fewer tokens than naive grep. Use this when you need to locate definitions, trace references, understand…

sverklo/sverklo · 96 tokens

delegation

Read this before dispatching agents. Every rule here was paid for. project/agents/jobs.md covers the tracker the work is filed in; project/agents/harness.md covers the tool the agents run inside.

bensyverson/jobs · 0 tokens

ipc-contract-auditor

Use when IPC or command-surface drift is possible — after adding, renaming, or removing a Tauri command, a SidecarCommand/SidecarEvent variant, or a tauri-api.ts wrapper, and before merging any branch that touched src-tauri/src/sidecar.rs, src-tauri/sidecar-opencode/src/types.ts, src-tauri/src/lib.rs, or…

kevinlin/cowork-z · 105 tokens

orbit-task-pilot

Read-only bounded preflight for Orbit task metadata. Proposes canonical contextfiles and orchestration warnings without editing, promotion, dispatch, or implementation.

danieljhkim/orbit · 34 tokens

EXECUTION_PROTOCOL

Default execution workflow for AI coding agents working on implementation or documentation tasks in this repository.

zyqzyq/Unfour · 0 tokens