themadorg/madmail/update-cli-docs
Claude Code and agent skill by themadorg/madmail
- community
Checking that the SKILL.md file is still in the repository.
Update the Madmail CLI operator reference in docs/guide/cli/ after adding, changing, or removing madmail subcommands. Also covers the man page (docs/man/madmail.1.scd), shell tab completion verification (clap-generated), JSON schemas, TDD parity matrix, and landing-site search index. Use when the user asks to update CLI docs, man page, completions, document a new madmail command, sync docs/cli with clap, or runs /update-cli-docs.
Install
npx vskill@latest install themadorg/madmail/update-cli-docsSKILL.md
Update CLI Documentation
Keep `docs/guide/cli/` in sync with the madmail CLI (clap definitions + ctl/ handlers). This is the primary operator reference; it is published at /docs/guide/cli/ on the landing site.
Path note: People often say "docs/cli" — the canonical directory isdocs/guide/cli/.
1. Orient — source of truth
Read these before editing docs:
| Layer | Path | What it defines | |
|---|---|---|---|
| Command tree | crates/chatmail-config/src/cli.rs | Subcommands, aliases, global flags | |
| Install / TLS CLI | crates/chatmail-config/src/install_cli.rs | install, certificate flags | |
| Dispatch | crates/chatmail/src/ctl/dispatch.rs | Which commands are implemented vs not_implemented | |
| Handler | crates/chatmail/src/ctl/<module>.rs | Behavior, prompts, JSON data fields | |
| JSON envelope | crates/chatmail/src/ctl/output.rs | --json success/error format | |
| Parity matrix | docs/TDD/14-cli-tools.md | Implementation status, ctl/ module map | |
| Madmail v1 reference | context/madmail/docs/chatmail/commands.md | Behavior parity (if present) | |
| Man page source | docs/man/madmail.1.scd | Hand-written overview (synopsis, command list, options) | |
| Man page render | docs/man/madmail.1 | Generated roff, embedded at compile time | |
| Tab completion | crates/chatmail/src/ctl/docs.rs | Auto-generated from clap via clap_complete |
2. Verify live CLI
Build and inspect help output; docs must match clap, not guesswork:
Production binary name is `madmail`; dev builds use `chatmail`. Write examples as madmail … everywhere in docs.
For JSON shapes, read the handler's CtlOut::emit / done calls or run with --json against a dev server when practical.
3. File layout
Naming: kebab-case filenames mirror the CLI path: madmail federation dismiss-list → federation-dismiss-list.md.
4. Page templates
Parent command page (<command>.md)
Use for commands with subcommands or rich overview. Include:
# \<command>\`` title (backtick-wrapped command name)- One-line description
## Synopsiswith fencedbashblock## Global flags— copy table from global-flags.md (parent pages only)## Subcommandstable## Examples## Notes(behavior caveats,madmail reloadreminders)## Subcommand pagesbullet list linking to leaf pages## JSON outputsection → link tojson-output.md#<anchor>- Footer (see §5)
Leaf subcommand page (<command>-<sub>.md)
Shorter; omit global flags table unless the subcommand is standalone.
Alias page (<alias>.md)
Point to canonical command; keep for discoverability and README alias table:
5. Footer conventions
Every page ends with:
- Parent pages:
[← CLI index](README.md) · [Global flags](global-flags.md) - Leaf pages:
[← \parent\](parent.md) · [CLI index](README.md) · [Global flags](global-flags.md) - Source link: point to the
ctl/module that implements the command (orcli.rsfor top-level-only commands).
6. Checklist by change type
New subcommand (implemented)
- [ ] Create leaf page
<parent>-<sub>.mdfrom template - [ ] Update parent
<parent>.md: subcommands table, subcommand pages list, examples - [ ] Add
### \<parent> <sub>\`section injson-output.mdwith realdata` fields - [ ] Add link under correct section in
README.md - [ ] Update
docs/TDD/14-cli-tools.mdcommand index row (status → done, guide link,ctl/module) - [ ] If alias: add alias page + row in README "Command aliases" table
- [ ] If DB-backed toggle: note "run
madmail reload" in Notes - [ ] If new top-level command or alias: update
docs/man/madmail.1.scdDESCRIPTION section →make man - [ ] Verify tab completion includes the command (see §13)
Changed flags / behavior
- [ ] Update affected leaf + parent pages (Synopsis, Options, Examples, Notes)
- [ ] Update matching
json-output.mdsection ifdatashape changed - [ ] Re-run
--helpand spot-check against handler - [ ] If global flags or top-level synopsis changed: update
docs/man/madmail.1.scdOPTIONS/SYNOPSIS →make man
New top-level command
- [ ] Add
Commandvariant incli.rs(user's code change — doc follows) - [ ] Create
<command>.md+ leaf pages as needed - [ ] Wire into
README.mdunder the right category section - [ ] Add
json-output.mdsections - [ ] Add row to
docs/TDD/14-cli-tools.md(both command index and category matrix) - [ ] Add dispatch entry in
dispatch.rs(implementation) - [ ] Add entry to
docs/man/madmail.1.scdDESCRIPTION (correct category subsection) - [ ] Run
make manand commitdocs/man/madmail.1 - [ ] Verify tab completion (see §13); add/extend test in
docs.rsif alias completion is non-obvious
Planned / not implemented
- [ ] Page may exist with
*(planned)*or*(defer)*in README — do not invent flags - [ ] Match
not_implemented()list indispatch.rs - [ ] Status in
14-cli-tools.md: planned or defer
Removed command
- [ ] Delete or mark deprecated in page + README
- [ ] Remove
json-output.mdsection - [ ] Update
14-cli-tools.md
7. README.md index structure
README.md groups commands into fixed sections — place new entries in the right group:
- Server lifecycle (
run,install,upgrade,reload, …) - Admin & access (
admin-token,admin-web,certificate) - Accounts & registration
- Policy & delivery (
federation,endpoint-cache,sharing, …) - Services & limits (
port,message-size,webimap,push,tasks, …) - Web content (
html-export,html-serve) - IMAP tooling
- Utilities
Mark unimplemented entries: ### [\creds\](creds.md) *(planned)*
Also maintain the Command aliases table at the top when adding visible_aliases.
8. json-output.md anchors
Anchor IDs are GitHub-style slugs of the heading text:
| Heading | Anchor | |
|---|---|---|
### accounts create | #accounts-create | |
### admin-web enable / disable / path | #admin-web-enabledisablepath |
Leaf pages link: json-output.md#accounts-create. When adding a section, place it under the matching category heading (Server lifecycle, Admin & access, …).
Document:
- Full success envelope example with realistic
data - Special cases from
json-output.md"Exceptions" table (admin-token --raw,create-user --json-only, etc.)
9. Cross-references
Update links in other docs only when the command is central to that topic:
| Doc | When to touch | |
|---|---|---|
docs/TDD/14-cli-tools.md | Always — parity matrix | |
docs/TDD/<feature>.md | Feature mentions CLI (e.g. 23-push-notifications.md → push.md) | |
docs/project/user-guide/07-admin-and-cli.md | High-level overview only — not per-flag reference | |
docs/man/madmail.1.scd | New top-level commands, aliases, global OPTIONS/SYNOPSIS changes | |
docs/guide/cli/completion.md | Only if completion install paths or hidden helpers change |
Do not duplicate the full CLI reference into the user guide; link to docs/guide/cli/README.md instead.
10. Landing site search index
After adding or renaming doc files, regenerate the documentation tree (picks up new docs/guide/cli/*.md automatically):
This updates landing/src/lib/assets/documentation.json and search-index.json. Commit those if the landing site is deployed from repo assets.
11. Quality bar
- Examples must be copy-pasteable — real flag names from
--help - No invented flags — if not in clap, don't document it
- Consistent binary name —
madmailin prose; mentionchatmailonly for dev builds - Reload reminder — DB-backed settings (
push,webimap,admin-web,port, …) needmadmail reload - Destructive ops — document
-y/--yesand confirmation behavior - Username expansion — note
@domain expansion when handler does it - Match existing tone: concise tables, short Notes, no filler
12. Man page (docs/man/madmail.1.scd)
The man page is a hand-written summary, not generated from clap. The rendered docs/man/madmail.1 is committed and embedded at compile time (crates/chatmail/src/ctl/docs.rs).
Update .scd when:
- Adding or removing a top-level command (or documenting a new alias like
pr→proxy) - Changing global flags (
OPTIONSsection) or common SYNOPSIS forms - Changing install/completion behavior described in
NOTESorEXAMPLES
Do not duplicate every subcommand flag in the man page — that detail lives in docs/guide/cli/. The man page lists command families and one-line descriptions (see existing DESCRIPTION subsections).
Regenerate after editing:
Commit both madmail.1.scd and madmail.1. On system install, madmail install and madmail upgrade install the embedded page to /usr/share/man/man1/<binary>.1.
13. Tab completion (shell TAB)
Completions are auto-generated from clap — there are no hand-edited completion script files in the repo.
| What | How | |||
|---|---|---|---|---|
| Generator | clap_complete in crates/chatmail/src/ctl/docs.rs | |||
| Operator command | `madmail completion bash\ | zsh\ | fish` | |
| System install | madmail install writes to FHS paths (see completion.md) | |||
| Tests | docs.rs tests (e.g. bash_completion_includes_proxy_subcommand) |
After changing cli.rs (new commands, aliases, flag renames):
- Rebuild:
cargo build -p chatmail - Spot-check:
./target/debug/chatmail completion bash | grep <command> - For new aliases (e.g.
pr→proxy): confirm prefix completion works; add a test indocs.rsif non-trivial (seebash_completion_prefix_pr_matches_proxy) - Run:
cargo test -p chatmail bash_completion
No separate "completion doc" update is needed unless install paths or hidden helpers (generate-man, generate-fish-completion) change — then edit docs/guide/cli/completion.md.
14. Quick workflow
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.grok/skills/update-cli-docs/SKILL.md
Popularity
- Repository stars
- 190
- Repository forks
- 20
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/themadorg/madmail/update-cli-docs)