# Docsmith

> This skill keeps code and docs in sync by generating a README skeleton from a Python project and a CHANGELOG draft from git history (Conventional Commits). Use it when the user says "生成文档", "更新 README", "docsmith", "同步文档", "generate docs", or "生成 CHANGELOG".

- Skill: `whaojie797-design/docsmith` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add whaojie797-design/docsmith`
- Raw SKILL.md: https://api.skillmd.com/api/skills/whaojie797-design/docsmith/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: whaojie797-design (https://skillmd.com/u/whaojie797-design)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/whaojie797-design/docsmith

---


# Doc Smith

## Overview
Stop letting docs rot. Doc Smith generates a README draft from your code and a CHANGELOG draft from your git history, so the agent can propose updates instead of hand-waving.

## When to Use
- The user says "生成文档", "更新 README", "docsmith", "同步文档", "generate docs", "生成 CHANGELOG".
- After a batch of changes, to refresh the changelog.

## Procedures
1. **Decide scope**: ask the user whether they want a README, a CHANGELOG, or both.
2. **Generate**:
   - README: `python scripts/gen_readme.py <project_dir>` -> `README.draft.md`
   - CHANGELOG: `python scripts/gen_changelog.py <project_dir>` -> `CHANGELOG.draft.md`
3. **Review, don't overwrite**: show the draft and let the user confirm before writing the real `README.md` / `CHANGELOG.md`. Never silently clobber existing docs.
4. **Fill placeholders**: the README draft contains `TODO:` markers — ask the user for the one-line description and a usage example, then write the final file.

## Bundled Resources
- `scripts/gen_readme.py` — stdlib `ast`-based README skeleton (modules / functions / classes).
- `scripts/gen_changelog.py` — groups `git log` by Conventional Commits type.
- `references/doc-conventions.md` — README structure and CHANGELOG format.

## Guardrails
- Drafts only: always confirm before writing over `README.md` / `CHANGELOG.md`.
- If a project isn't a git repo, `gen_changelog.py` tells the user instead of failing silently.
- Keep generated docs honest: don't invent features the code doesn't have.

