claude-anvil / kdp
CLAUDE.md2 starsChanged 5 months agoMITView on GitHub
A Claude Code plugin (not a software project) that automates Amazon KDP (Kindle Direct Publishing) workflows for book authors: manuscript auditing, listing craft, and the full publishing pipeline. It handles technical books (LaTeX, math-heavy), fiction, and general nonfiction. There is no build system, no test suite, no compiled code. The entire plugin is Markdown files with YAML frontmatter. "Development" means editing skills, commands, and reference docs. The mcp/ directory contains a TypeScript MCP server (kdp-cover) that generates book cover images…
- Reads credentials
- Installs packages
In this repository11 other files it gives its agents.
- bookwright/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- crier/CLAUDE.mdCLAUDE.md
- locksmith/CLAUDE.mdCLAUDE.md
- mf/CLAUDE.mdCLAUDE.md
- papermill/CLAUDE.mdCLAUDE.md
- pub-pipeline/CLAUDE.mdCLAUDE.md
- repoindex/CLAUDE.mdCLAUDE.md
- research-agent/CLAUDE.mdCLAUDE.md
- vista/CLAUDE.mdCLAUDE.md
- worldsmith/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
All skills read .claude/kdp.local.md (in the user's target project, not this repo).
- Very specific: line 58
Every skill includes a "Load user config" step early in its workflow.
- Very specific: line 70
All skills (skills/*/SKILL.md) share:
- Distinctive: line 110
After making changes, verify:
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
A Claude Code plugin (not a software project) that automates Amazon KDP (Kindle Direct Publishing) workflows for book authors: manuscript auditing, listing craft, and the full publishing pipeline. It handles technical books (LaTeX, math-heavy), fiction, and general nonfiction.
There is no build system, no test suite, no compiled code. The entire plugin is Markdown files with YAML frontmatter. "Development" means editing skills, commands, and reference docs.
Architecture
Plugin Structure
.claude-plugin/plugin.json # Plugin manifest (name, version, metadata)
skills/ # 3 skill files (the core logic)
commands/ # 3 slash commands (thin wrappers that trigger skills)
docs/ # Reference docs and config template
mcp/ # TypeScript MCP server for cover generation
.mcp.json # MCP server registration for Claude CodeMCP Component
The mcp/ directory contains a TypeScript MCP server (kdp-cover) that generates book cover images using the OpenAI image generation API. This is the first plugin in the marketplace with runtime dependencies.
Setup (required before first use):
cd mcp/
npm installEnvironment variable required: OPENAI_API_KEY must be set in the shell environment.
Tools exposed by the MCP server:
kdp_cover_specs: compute KDP cover dimensions and bleed from trim size and page countkdp_generate_cover: generate a front cover image via DALL-E given art direction and specskdp_generate_full_wrap: generate a full-wrap paperback cover PDF (front + spine + back)kdp_validate_cover: validate an existing cover file (eBook, paperback front, or full wrap) against KDP requirements via image metadata; mechanical, no generation
The .mcp.json file at the plugin root registers the server so Claude Code starts it automatically when the plugin is active. The server is launched via mcp/run.sh, which handles npm invocation.
Skill → Command Mapping
Each skill has a corresponding slash command. Commands are minimal: just frontmatter with description: and a one-line instruction that triggers the skill. The mapping:
| Command file | Skill directory | Purpose |
commands/kdp-audit.md | skills/kdp-audit/ | Audit manuscript against KDP requirements |
commands/kdp-listing.md | skills/kdp-listing/ | Craft Amazon listing: blurb, keywords, categories, bio |
commands/kdp-publish.md | skills/kdp-publish/ | Full KDP publishing workflow |
User Config
All skills read .claude/kdp.local.md (in the user's target project, not this repo). The template is at docs/user-config-template.md. YAML frontmatter holds structured fields (author, kdp); the markdown body holds free-form notes.
Every skill includes a "Load user config" step early in its workflow. If the config file is missing, the skill offers to create one from the template using ${CLAUDE_PLUGIN_ROOT}/docs/user-config-template.md.
Reference Docs
Skills reference detailed requirements docs via ${CLAUDE_PLUGIN_ROOT}/docs/:
kdp-reference.md: KDP formatting, pricing, submission guidekdp-exemplars.md: Fiction blurb examples, keyword strategies, category tactics
Conventions
Skill File Structure
All skills (skills/*/SKILL.md) share:
- YAML frontmatter:
nameanddescription(description lists trigger phrases for auto-detection) - Numbered workflow steps with tool annotations in parentheses:
(Read tool),(Bash tool),(Glob/Grep tools) - "Reference Files" section pointing to
${CLAUDE_PLUGIN_ROOT}/docs/
The audit skill (kdp-audit) additionally includes:
4. Gap report template using the Critical (Must Fix) / Warnings (Should Fix) / Passed structure
5. "Offer to Fix" section listing automatable remediation
6. "Important Notes" section with key gotchas
Command File Structure
Commands (commands/*.md) are 3-5 lines:
---
description: "One-line for slash-command help"
---
Brief instruction triggering the corresponding skill.Audit Report Pattern
The kdp-audit skill produces a structured gap report:
# KDP Audit Report: {book title}
## Summary (Status, Manuscript type, Format, Target)
## Critical Gaps (Must Fix)
## Warnings (Should Fix)
## Interior Formatting
## Cover Specifications
## Metadata
## Recommended Next Steps${CLAUDE_PLUGIN_ROOT} References
Skills reference docs via ${CLAUDE_PLUGIN_ROOT}/docs/filename.md. This variable resolves to the plugin's installation directory at runtime. When adding new references, verify the target file exists in docs/.
Validation
After making changes, verify:
# All skill frontmatter has name and description
for f in skills/*/SKILL.md; do echo "=== $f ===" && head -5 "$f" && echo; done
# All command frontmatter has description
for f in commands/*.md; do echo "=== $f ===" && head -5 "$f" && echo; done
# All ${CLAUDE_PLUGIN_ROOT} references point to existing files
grep -roh '\${CLAUDE_PLUGIN_ROOT}/[^`"]*' skills/ | sort -uDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

