agentleFS
queeliusqueelius/claude-anvil/kdp/CLAUDE.md

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

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
  1. Very specific:

    All skills read .claude/kdp.local.md (in the user's target project, not this repo).

    line 56
  2. Very specific:

    Every skill includes a "Load user config" step early in its workflow.

    line 58
  3. Very specific:

    All skills (skills/*/SKILL.md) share:

    line 70
  4. Distinctive:

    After making changes, verify:

    line 110

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 Code

MCP 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 install

Environment 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 count
  • kdp_generate_cover: generate a front cover image via DALL-E given art direction and specs
  • kdp_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 fileSkill directoryPurpose
commands/kdp-audit.mdskills/kdp-audit/Audit manuscript against KDP requirements
commands/kdp-listing.mdskills/kdp-listing/Craft Amazon listing: blurb, keywords, categories, bio
commands/kdp-publish.mdskills/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 guide
  • kdp-exemplars.md: Fiction blurb examples, keyword strategies, category tactics

Conventions

Skill File Structure

All skills (skills/*/SKILL.md) share:

  1. YAML frontmatter: name and description (description lists trigger phrases for auto-detection)
  2. Numbered workflow steps with tool annotations in parentheses: (Read tool), (Bash tool), (Glob/Grep tools)
  3. "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 -u

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.