ZhiWei: Agent for Claude Code

.claude/agents/docs-code-sync.md

docs-code-sync is an agent for Claude Code from ntygod/ZhiWei. It costs 346 tokens per session (1,594 once invoked), scanned A, original, MIT.

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

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is ntygod/ZhiWei's own configuration. It tells Claude Code how to work on ZhiWei itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ZhiWei configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ntygod/ZhiWei. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ntygod/ZhiWei/develop/.claude/agents/docs-code-sync.md
Clone the repo
git clone --depth 1 https://github.com/ntygod/ZhiWei

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docs-code-sync

README.md
[![agentmods](https://agentmods.dev/badge/agents/ntygod/zhiwei/docs-code-sync/github.svg)](https://agentmods.dev/agents/ntygod/zhiwei/docs-code-sync)
Your own site
<a href="https://agentmods.dev/agents/ntygod/zhiwei/docs-code-sync"><img src="https://agentmods.dev/badge/agents/ntygod/zhiwei/docs-code-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docs-code-sync

Your own site · 80×15
<a href="https://agentmods.dev/agents/ntygod/zhiwei/docs-code-sync"><img src="https://agentmods.dev/badge/agents/ntygod/zhiwei/docs-code-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00346 $0.01594
Opus 5.5 $0.00138 $0.00638
Sonnet 5.5 $0.00069 $0.00319
Haiku 4.5 $0.00035 $0.00159

Measured 2mo ago against content hash b60ec5164110, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo ago.

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. 2mo ago 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 2mo ago), licensed MIT. It adds 346 tokens to every session and 1,594 once invoked, about $0.0014 per session on Opus 5.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

docs-code-sync compared with agents from other repositories

docs-code-sync next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
docs-code-syncntygod/ZhiWeiAgent1372mo agoMITA346Claude Code
php-code-review-expertgiuseppe-trisciuoglio/developer-kitAgent3671mo agoMITA68Claude Code
spring-code-reviewerloiane/specs-driven-development-spring-angularAgent62yesterdayMITA41Claude Code
sverklo-exploresverklo/sverkloAgent822mo agoMITA96Claude Code
bank-extractledq/resumeryAgent21mo agoMITA91Claude Code
Patronus Securitytenable/cyberagents-exchangeAgent23yesterdaynoneA27Claude Code
accessibility-specialistaltmemy/claude-code-templatesAgent257mo agononeA67Claude Code