tuzi-update-claude-md
Update CLAUDE.md
Analyzes code review feedback or development issues, extracts general rules, and updates documentation with a layered strategy (summary in CLAUDE.md, details in docs/CODING_RULES.md).
Core Principle
CLAUDE.md must stay concise. Summary rules only, 1-2 sentences each.
| Document | Content | Line Limit |
|---|---|---|
CLAUDE.md |
Core summary rules (1-2 sentences) | ≤ 300 lines |
docs/CODING_RULES.md |
Detailed rules + error/correct examples | No limit |
docs/FEATURE_FLOWS.md |
Feature flow documentation | No limit |
Parameters
$ARGUMENTS: Description of the discovered issue or rule (optional)
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .tuzi-skills/tuzi-update-claude-md/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.tuzi-skills/tuzi-update-claude-md/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-update-claude-md/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-update-claude-md/EXTEND.md │ User home │ └──────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: CLAUDE.md line limit | Rule categories | Commit message format
Workflow
Step 1: Gather Information
If $ARGUMENTS provided: Parse the described issue or rule.
If no arguments: Ask user what issue was discovered, or check recent git diff and commit messages:
git diff HEAD~3 --stat
git log --oneline -5
Step 2: Assess Rule Priority
| Priority | Criteria | Action |
|---|---|---|
| High | Frequent error pattern, causes serious bugs, core project convention | Add to both CLAUDE.md + CODING_RULES.md |
| Normal | Occasional issue, scenario-specific, detailed examples | Only CODING_RULES.md |
| Skip | One-off typo, overly specific business logic, already covered | Do not record |
Step 3: Check Document Status
wc -l CLAUDE.md
If over 250 lines, prompt user to clean up before adding.
Step 4: Update docs/CODING_RULES.md
Add to the appropriate section using this format:
### [Issue Title]
**Scenario**: [When this issue occurs]
❌ **Wrong**:
\`\`\`typescript
// incorrect code
\`\`\`
✅ **Correct**:
\`\`\`typescript
// correct code
\`\`\`
**Reason**: [Why]
Section categories: TypeScript | React Components | Service Worker | Cache & Storage | API & Task Processing | UI Interaction
Step 5: Update CLAUDE.md (High Priority Only)
Add 1-2 sentence summary only:
N. **Rule Name**: Brief description (1-2 sentences)
Location: Under ## 核心编码规则 or equivalent section.
Step 6: Check for Duplicates
- Check both CLAUDE.md and CODING_RULES.md for similar existing rules
- Supplement existing rules rather than creating new ones
- Avoid document bloat from redundancy
Step 7: Confirm Update
Display summary:
## Documentation Updated
### docs/CODING_RULES.md
- Section: [section name]
- Added: [rule description]
- Includes: Error/correct examples + explanation
### CLAUDE.md (if applicable)
- Section: [section name]
- Added summary: [rule summary]
### Document Status
- CLAUDE.md: XXX lines (limit 300) ✅/⚠️
- CODING_RULES.md: XXX lines
Step 8: Commit
git add CLAUDE.md docs/CODING_RULES.md
git commit -m "docs: add coding rule - [rule name]"
Periodic Cleanup
When CLAUDE.md approaches 300 lines:
- Merge similar rules
- Remove outdated rules
- Move overly detailed rules to CODING_RULES.md
- Update cross-references
Example Usage
# With argument
/tuzi-update-claude-md Claude keeps forgetting to add theme='light' to TDesign Tooltip
# Interactive
/tuzi-update-claude-md
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
More from tuziapi/tuzi-skills
tuzi-short-video
为小红书、抖音、X/Twitter、视频号等平台生成短视频内容。分析用户输入,自动适配平台规格,生成视频脚本并调用视频生成后端。当用户要求"生成短视频"、"做一个视频"、"短视频"或为社交平台创建视频内容时使用。
161tuzi-image-gen
通过兔子API(nano-banana 模型)、Google、OpenAI、DashScope 和 Replicate 进行 AI 图片生成。支持文生图、参考图片、宽高比、模型选择,以及 OpenAI 兼容网关方言切换。当用户要求生成、创建或绘制图片时使用。
155tuzi-video-gen
通过兔子API进行AI视频生成。支持 Veo、Sora、Kling、Seedance 等模型,单视频和长视频(多段合成)模式。当用户要求生成视频、创建视频或需要视频生成后端时使用。
138tuzi-comic
知识漫画创作工具,支持多种画风和语调。创建原创教育漫画,包含详细分镜布局和顺序图片生成。当用户要求创建"知识漫画"、"教育漫画"、"传记漫画"、"教程漫画"时使用。
134tuzi-infographic
生成专业信息图,包含 21 种布局类型和 20 种视觉风格。分析内容,推荐布局×风格组合,生成可发布的信息图。当用户要求创建"信息图"、"可视化"、"高密度信息大图"、"visual summary"时使用。
134tuzi-post-to-wechat
通过 API 或 Chrome CDP 发布内容到微信公众号。支持文章发布(HTML、Markdown 或纯文本输入)和图文消息发布(多图)。当用户提到"发布公众号"、"微信公众号"、"贴图"、"图文"、"文章"时使用。
132