@ttaqt/novel-workflow-mcp
Version:
MCP server for AI-assisted novel writing workflow with real-time web dashboard
130 lines (119 loc) • 5.86 kB
JavaScript
const prompt = {
name: 'write-scene',
title: 'Write Story Scene',
description: 'Guide for writing a specific scene from the scenes.md document. Provides comprehensive instructions for scene writing, including reading _Prompt fields, marking progress, and completion criteria.',
arguments: [
{
name: 'storyName',
description: 'Story name in kebab-case for the scene to write',
required: true
},
{
name: 'sceneId',
description: 'Specific scene ID to write (e.g., "1.1", "2.3", "5.2")',
required: false
}
]
};
async function handler(args, context) {
const { storyName, sceneId } = args;
if (!storyName) {
throw new Error('storyName is a required argument');
}
const messages = [
{
role: 'user',
content: {
type: 'text',
text: `Write ${sceneId ? `scene ${sceneId}` : 'the next pending scene'} for the "${storyName}" story.
**Context:**
- Project: ${context.projectPath}
- Story: ${storyName}
${sceneId ? `- Scene ID: ${sceneId}` : ''}
${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''}
**Writing Workflow:**
1. **Check Current Status:**
- Use the story-status tool with storyName "${storyName}" to see overall progress
- Read .novel-workflow/stories/${storyName}/scenes.md to see all scenes
- Identify ${sceneId ? `scene ${sceneId}` : 'the next pending scene marked with [ ]'}
2. **Start the Scene:**
- Edit .novel-workflow/stories/${storyName}/scenes.md directly
- Change the scene marker from [ ] to [-] for the scene you're starting
- Only one scene should be in-progress at a time
3. **Read Scene Guidance and Context:**
- **CRITICAL**: The _Prompt field is GUIDANCE FOR YOU, not content to include in the story
- Read the _Prompt field to understand writing requirements
- Read .novel-workflow/steering/character-profiles.md for character details
- Read .novel-workflow/steering/world-building.md for setting rules
- Read .novel-workflow/stories/${storyName}/outline-detailed.md for plot context
- Understand scene type (Active vs Reactive) and the three elements required
4. **Write the Scene (IMPORTANT - Novel Prose Only):**
- **WRITE PURE NOVEL PROSE** - No labels, no markers, no structural annotations
- **DO NOT include** any of these in the actual scene text:
❌ "Character: xxx"
❌ "Task: xxx"
❌ "Dialogue: xxx"
❌ "Emotion: xxx"
❌ Any "_Prompt" format markers
- **ONLY WRITE**: Pure narrative prose, dialogue, and description
- Follow the _Prompt guidance internally (as writing principles)
- For Active scenes, include: Goal (what character wants) / Conflict (obstacles) / Disaster (setback)
- For Reactive scenes, include: Reaction (emotional response) / Dilemma (weighing options) / Decision (choosing next action)
- Match the character voice and personality from character-profiles.md
- Use character's specific language habits, catchphrases, and speech patterns
- Follow the world-building rules from world-building.md
- Write vivid, engaging prose with strong imagery
- Show don't tell - use action and small gestures to reveal emotion
- Use sensory details (sight, sound, smell, touch, taste) appropriately
- Make dialogue natural with filler words, interruptions, incomplete sentences
- Let different characters speak differently
- Add realistic imperfections and small mistakes
- Control pacing with sentence length variation
- Avoid AI common problems: overly rational characters, too-perfect dialogue, excessive description
- Maintain consistent POV and tense
5. **Complete the Scene:**
- Verify all success criteria from the _Prompt are met
- Check that the scene:
- Advances the plot or develops character
- Has clear conflict or tension
- Follows the outline guidance
- Matches the story's tone and style
- Meets the specified word count range
- Edit .novel-workflow/stories/${storyName}/scenes.md directly
- Change the scene marker from [-] to [x] for the completed scene
- Only mark complete when the scene is fully written and polished
**CRITICAL - Avoid Common Mistakes:**
❌ **DO NOT write structural labels in the scene** (e.g., "Character:", "Task:", "Dialogue:")
❌ **DO NOT include _Prompt format** in the actual prose
❌ **DO NOT write meta-instructions** in the scene text
✅ **WRITE PURE NOVEL PROSE** - Just the story, like a real published novel
**Important Guidelines:**
- Always mark a scene as in-progress before starting to write
- The _Prompt field is GUIDANCE, not content - internalize it, don't copy it
- Before writing, READ these for context:
1. character-profiles.md - for character voices and habits
2. world-building.md - for setting and rules
3. outline-detailed.md - for plot context
- Stay true to character voices and personalities
- Respect the world-building rules and constraints
- Each scene should have vivid sensory details and strong imagery
- Balance action, dialogue, and internal thoughts
- Every scene must have conflict or tension
- If a chapter has multiple scenes (e.g., 4.1, 4.2), complete them in order
- If you encounter creative blocks, review the detailed outline for guidance
**Tools to Use:**
- story-status: Check overall progress
- Edit: Directly update scene markers in scenes.md file
- Read/Write/Edit: Write the actual scene content
- Read: Review steering documents for character and world details
Please proceed with writing ${sceneId ? `scene ${sceneId}` : 'the next scene'} following this workflow.`
}
}
];
return messages;
}
export const writeScenePrompt = {
prompt,
handler
};
//# sourceMappingURL=write-scene.js.map