home-mcp: Command for Claude Code

.claude/commands/docs-update.md

docs-update is a command for Claude Code from shenjingnan/home-mcp. It costs 11 tokens per session (1,593 once invoked), scanned A, original, MIT.

A command for making selected updates across project documentation, including path aliases, code examples, formatting, and links. A path alias is a shorthand such as @/utils for referring to a project file.

In plain words
What is it for?
Use it to update all or selected MDX files, convert relative imports to project aliases, improve TypeScript, JavaScript, or shell examples, repair formatting, and check links or images.
Why use it?
It replaces repetitive manual edits and helps keep documentation imports, examples, Markdown structure, and links consistent.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

This is shenjingnan/home-mcp's own configuration. It tells Claude Code how to work on home-mcp 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 home-mcp configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { Service } from "../services/file";.

Reuse

Borrowing it

Nothing to install: this file belongs to shenjingnan/home-mcp. 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/shenjingnan/home-mcp/main/.claude/commands/docs-update.md
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/home-mcp

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-update

README.md
[![agentmods](https://agentmods.dev/badge/commands/shenjingnan/home-mcp/docs-update.svg)](https://agentmods.dev/commands/shenjingnan/home-mcp/docs-update)
Your own site
<a href="https://agentmods.dev/commands/shenjingnan/home-mcp/docs-update"><img src="https://agentmods.dev/badge/commands/shenjingnan/home-mcp/docs-update.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 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,593 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00011 $0.01593
Opus 5 $0.00005 $0.00796
Sonnet 5 $0.00002 $0.00319
Haiku 4.5 $0.00001 $0.00159

Measured 8d ago against content hash 4898092ccff7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

docs-update scanned grade A with 1 finding 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 8d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "%{http_code}" http://localhost:3000
.claude/commands/docs-update.md · 205 lines

How it starts

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

$1 $2

我需要更新现有的文档内容。请帮我完成以下任务:

1. 确定更新范围

根据我提供的参数 <scope><target>,请:

  • 验证更新范围:确认要更新的文档范围
  • 确定目标文件:根据参数确定具体要处理的文件
  • 制定更新策略:选择合适的更新方法

2. 支持的更新类型

path-aliases - 路径别名修复

  • 参数格式/docs-update path-aliases [file-or-directory]
  • 作用范围
    • 不指定参数:扫描所有 docs/content/ 下的 .mdx 文件
    • 指定文件:更新特定文件(如 development/contributing.mdx
    • 指定目录:更新整个目录(如 mcp-tools/
  • 修复内容
    • 将相对路径 .././ 替换为 @/xxx 格式
    • 识别代码块中的 import 语句
    • 确保路径别名符合项目规范

code-examples - 代码示例优化

  • 参数格式/docs-update code-examples [type]
  • 支持类型
    • typescript - TypeScript 代码示例
    • javascript - JavaScript 代码示例
    • bash - 命令行示例
  • 优化内容
    • 统一代码风格
    • 添加类型注解
    • 更新为最佳实践

format-fix - 格式修复

  • 参数格式/docs-update format-fix [file-or-directory]
  • 修复内容
    • MDX 语法错误
    • Markdown 格式问题
    • 代码块语法高亮
    • 表格格式修正

links-update - 链接更新

  • 参数格式/docs-update links-update [type]
  • 更新类型
    • internal - 内部链接
    • external - 外部链接
    • images - 图片链接
  • 检查内容
    • 链接有效性
    • 链接文本准确性
    • 锚点正确性

3. 路径别名映射规则

基于项目的路径别名系统:

// 项目别名映射
{
  "@/*": ["*"],                    // 根目录快速访问
  "@/types/*": ["types/*"],        // 类型定义目录
  "@/utils/*": ["utils/*"],        // 工具函数目录
  "@/services/*": ["services/*"],  // 服务层目录
  "@/mocks/*": ["mocks/*"],        // Mock 数据目录
  "@/test/*": ["test/*"]           // 测试配置目录
}

常见修复模式

// ❌ 需要修复的相对路径
import { Service } from "../services/file";
import { Type } from "../types/interface";
import { util } from "./utils/helper";
import { mock } from "../test/utils/mock";

// ✅ 修复后的别名路径
import { Service } from "@/services/file";
import { Type } from "@/types/interface";
import { util } from "@/utils/helper";
import { mock } from "@/test/utils/mock";

4. 更新流程

4.1 扫描阶段

  1. 识别目标文件:根据参数确定要处理的文件范围
  2. 内容分析:解析 MDX 文件,提取代码块
  3. 问题识别:检测需要修复的问题

4.2 修复阶段

  1. 路径别名修复:替换相对路径为别名格式
  2. 代码示例优化:改进代码质量和风格
  3. 格式修正:修复 MDX 语法和格式问题

Read the full file on GitHub · 205 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. 8d ago First seen · 205 lines · 0 tokens per session scan A 4898092ccff7

Subscribe to this mod's changes

docs-update is a command published in the GitHub repository shenjingnan/home-mcp (21 stars, last pushed 7mo ago), licensed MIT. It adds 11 tokens to every session and 1,593 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.