Custom Analysis Modules
Analysis modules are Claude prompt templates — a markdown file with YAML frontmatter that tells Claude how to analyze content and what structured output to produce. You can create your own modules to analyze any aspect of your writing.
How Modules Work
Each module is a single markdown file containing:
- YAML frontmatter — metadata about the module
- Instructions — a prompt telling Claude what to analyze
- Output schema — the JSON structure Claude must return
When you run an analysis, ChapterWise sends your content along with the module's prompt to Claude, which returns structured results in the Codex V1.2 analysis format.
Module Frontmatter
Every module starts with YAML frontmatter defining its metadata:
---
name: my_custom_module
displayName: My Custom Module
description: Analyzes your content for a specific quality
category: Writing Craft
icon: ph ph-magnifying-glass
applicableTypes: ["novel", "short_story", "screenplay"]
---
Frontmatter Fields
| Field | Required | Description |
|---|---|---|
name |
Yes | Module ID in snake_case (e.g., story_beats) |
displayName |
Yes | Human-readable name (e.g., Story Beats) |
description |
Yes | Brief description of what the module analyzes |
category |
Yes | Grouping category (e.g., Narrative Structure, Writing Craft) |
icon |
Yes | Phosphor icon class (e.g., ph ph-heartbeat) |
applicableTypes |
Yes | Content types this module can analyze |
Applicable Types
| Type | Description |
|---|---|
novel |
Long-form fiction |
short_story |
Short fiction |
screenplay |
Film/TV scripts |
theatrical_play |
Stage plays |
immersive_experience |
Interactive/experiential narratives |
Required Output Format
Every module must instruct Claude to return a JSON object with five fields:
{
"body": "Main analysis in markdown",
"summary": "One-line summary",
"children": [],
"tags": [],
"attributes": []
}
See the Analysis Output Format reference for the complete schema, attribute data types, and scoring conventions.
Creating a Custom Module
Step 1: Define Your Goal
Decide what aspect of writing you want to analyze. Good modules focus on a specific, well-defined quality — e.g., dialogue authenticity, subplot tracking, or foreshadowing effectiveness.
Step 2: Write the Module File
Here's a complete example module that analyzes dialogue quality:
---
name: dialogue_quality
displayName: Dialogue Quality
description: Evaluates dialogue authenticity, character voice distinction, and subtext
category: Writing Craft
icon: ph ph-chat-dots
applicableTypes: ["novel", "short_story", "screenplay", "theatrical_play"]
---
# Dialogue Quality Module
You are an expert literary analyst specializing in dialogue craft.
## Your Task
Analyze the provided content and evaluate:
1. **Voice Distinction** - How unique each character's speech patterns are
2. **Subtext** - What characters communicate beneath their words
3. **Naturalness** - Whether dialogue sounds like real speech
4. **Purpose** - Whether each exchange advances plot or character
## Output Format
Return your analysis as a JSON object with this structure:
\```json
{
"body": "## Dialogue Quality\n\n[Analysis of dialogue patterns and effectiveness]",
"summary": "[Brief assessment of dialogue quality]",
"children": [
{
"name": "Voice Distinction",
"summary": "How well characters sound unique",
"content": "## Voice Distinction\n\n[Analysis with examples]",
"attributes": [
{"key": "distinction_score", "name": "Distinction Score", "value": 7, "dataType": "int"}
]
}
],
"tags": ["dialogue", "voice", "character"],
"attributes": [
{"key": "overall_score", "name": "Overall Score", "value": 7, "dataType": "int"},
{"key": "speaker_count", "name": "Speaker Count", "value": 4, "dataType": "int"}
]
}
\```
## Guidelines
- Identify distinct speech patterns per character
- Rate scores 1-10 (5 = competent, 7 = good, 9+ = exceptional)
- Provide specific examples from the text
- Use markdown formatting in body and content fields
Step 3: Run Your Module
Locally with Claude: Use the ChapterWise analysis plugin with Claude Code or Claude Desktop. Point it at your module file and your content.
In the cloud on ChapterWise: Upload your module to run it against any manuscript in your library with automatic result storage and visualization.
Tips for Good Modules
- Be specific in your instructions — tell Claude exactly what to look for
- Define clear attributes with meaningful scores (use the 1-10 scale)
- Include 2-5 children for structured sub-sections
- Use snake_case for all IDs and attribute keys
- Provide example JSON so Claude knows the exact output shape
- Add guidelines at the end for scoring criteria and edge cases
Open Source
The ChapterWise analysis plugin and all built-in modules are open source under the MIT license.
GitHub: ansonphong/chapterwise-claude-plugins
You can browse the source of any built-in module to use as a starting point for your own.
Reference: See the Analysis Output Format for the complete V1.2 schema specification.