Rename Project concept to Novel across the stack

Renames the domain concept from Project to Novel throughout the backend
(entities, DTOs, services, endpoints, ProjectAccessService/Permission,
ProjectId foreign keys), MCP server (tool names and routes), and the
React/Vite frontend (types, hooks, routes, components). Adds a new EF
Core migration (RenameProjectToNovel) using RenameTable/RenameColumn to
preserve existing data instead of dropping/recreating tables. Updates
CLAUDE.md's structure section to reference Novels/ instead of Projects/.
This commit is contained in:
James Wampler
2026-08-17 23:03:09 -07:00
parent 0ab4f568b5
commit 4313c8f206
95 changed files with 3192 additions and 1660 deletions
+8 -8
View File
@@ -8,12 +8,12 @@ namespace Novelly.Mcp.Tools;
public static class CharacterTools
{
[McpServerTool(Name = "list_characters")]
[Description("List a project's character dossiers in full, including their relationships.")]
[Description("List a novel's character dossiers in full, including their relationships.")]
public static Task<CallToolResult> ListCharacters(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct) =>
api.GetAsync($"/api/projects/{projectId}/characters", ct);
api.GetAsync($"/api/novels/{novelId}/characters", ct);
[McpServerTool(Name = "get_character")]
[Description("Read one character's dossier.")]
@@ -24,11 +24,11 @@ public static class CharacterTools
api.GetAsync($"/api/characters/{characterId}", ct);
[McpServerTool(Name = "create_character")]
[Description("Add a character dossier to a project. Name is the only requirement — leave a field "
[Description("Add a character dossier to a novel. Name is the only requirement — leave a field "
+ "blank when the writer has not decided it yet rather than inventing detail.")]
public static Task<CallToolResult> CreateCharacter(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
[Description("The character's name.")] string name,
CancellationToken ct,
[Description("Protagonist, Antagonist, Deuteragonist, Supporting, Minor, Mentor, LoveInterest or Foil.")]
@@ -50,7 +50,7 @@ public static class CharacterTools
[Description("Anything else worth recording.")] string? notes = null,
[Description("Tags for cross-referencing. Unknown tags are created.")] string[]? tags = null,
[Description("Other names this character is known by.")] string[]? aliases = null) =>
api.PostAsync($"/api/projects/{projectId}/characters", new
api.PostAsync($"/api/novels/{novelId}/characters", new
{
name,
role = role ?? "Supporting",
@@ -197,7 +197,7 @@ public static class CharacterTools
api.PostAsync($"/api/arc-stages/{arcStageId}/beats", new { beatIds }, ct);
[McpServerTool(Name = "relate_characters")]
[Description("Record a relationship between two characters in the same project. Creates both directions "
[Description("Record a relationship between two characters in the same novel. Creates both directions "
+ "at once — characterId's side and relatedCharacterId's side — so the pair always shows up "
+ "on both dossiers.")]
public static Task<CallToolResult> RelateCharacters(
@@ -215,7 +215,7 @@ public static class CharacterTools
[McpServerTool(Name = "link_character_identity")]
[Description("Record that this character is really another character — e.g. a character introduced "
+ "under one name who is later revealed to be a character already in the project under "
+ "under one name who is later revealed to be a character already in the novel under "
+ "another name. Both characters keep their own dossier and beats; the canonical identity "
+ "is whichever character you link to.")]
public static Task<CallToolResult> LinkCharacterIdentity(
+6 -6
View File
@@ -8,12 +8,12 @@ namespace Novelly.Mcp.Tools;
public static class ManuscriptTools
{
[McpServerTool(Name = "list_chapters")]
[Description("List a project's chapters in manuscript order, with beat and word counts.")]
[Description("List a novel's chapters in manuscript order, with beat and word counts.")]
public static Task<CallToolResult> ListChapters(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct) =>
api.GetAsync($"/api/projects/{projectId}/chapters", ct);
api.GetAsync($"/api/novels/{novelId}/chapters", ct);
[McpServerTool(Name = "get_chapter")]
[Description("Read one chapter in full: its outline (beats) and its drafted prose.")]
@@ -24,10 +24,10 @@ public static class ManuscriptTools
api.GetAsync($"/api/chapters/{chapterId}", ct);
[McpServerTool(Name = "create_chapter")]
[Description("Add a chapter to a project. It goes at the end of the manuscript unless you supply a number.")]
[Description("Add a chapter to a novel. It goes at the end of the manuscript unless you supply a number.")]
public static Task<CallToolResult> CreateChapter(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
[Description("Chapter title.")] string title,
CancellationToken ct,
[Description("Position in the manuscript, 1-based.")] int? number = null,
@@ -37,7 +37,7 @@ public static class ManuscriptTools
[Description("Target length in words.")] int? targetWordCount = null,
[Description("The chapter's drafted text, in markdown, if you are writing it now.")] string? prose = null,
[Description("Tags for cross-referencing. Unknown tags are created.")] string[]? tags = null) =>
api.PostAsync($"/api/projects/{projectId}/chapters", new
api.PostAsync($"/api/novels/{novelId}/chapters", new
{
title,
number,
@@ -5,25 +5,25 @@ using ModelContextProtocol.Server;
namespace Novelly.Mcp.Tools;
[McpServerToolType]
public static class ProjectTools
public static class NovelTools
{
[McpServerTool(Name = "list_projects")]
[Description("List every novel project, with counts of characters, chapters and drafted words. "
+ "Start here to find the project id everything else needs.")]
public static Task<CallToolResult> ListProjects(NovelApiClient api, CancellationToken ct) =>
api.GetAsync("/api/projects", ct);
[McpServerTool(Name = "list_novels")]
[Description("List every novel, with counts of characters, chapters and drafted words. "
+ "Start here to find the novel id everything else needs.")]
public static Task<CallToolResult> ListNovels(NovelApiClient api, CancellationToken ct) =>
api.GetAsync("/api/novels", ct);
[McpServerTool(Name = "get_project_brief")]
[Description("Read a project's title, author, genre, logline, synopsis, notes and word-count target.")]
public static Task<CallToolResult> GetProject(
[McpServerTool(Name = "get_novel_brief")]
[Description("Read a novel's title, author, genre, logline, synopsis, notes and word-count target.")]
public static Task<CallToolResult> GetNovel(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct) =>
api.GetAsync($"/api/projects/{projectId}", ct);
api.GetAsync($"/api/novels/{novelId}", ct);
[McpServerTool(Name = "create_project")]
[Description("Create a new novel project.")]
public static Task<CallToolResult> CreateProject(
[McpServerTool(Name = "create_novel")]
[Description("Create a new novel.")]
public static Task<CallToolResult> CreateNovel(
NovelApiClient api,
[Description("Working title.")] string title,
CancellationToken ct,
@@ -33,14 +33,14 @@ public static class ProjectTools
[Description("Paragraph-length summary of the whole book.")] string? synopsis = null,
[Description("Free-form notes on theme, tone, comparable titles.")] string? notes = null,
[Description("Target manuscript length in words.")] int? targetWordCount = null) =>
api.PostAsync("/api/projects", new { title, author, genre, logline, synopsis, notes, targetWordCount }, ct);
api.PostAsync("/api/novels", new { title, author, genre, logline, synopsis, notes, targetWordCount }, ct);
[McpServerTool(Name = "update_project_brief")]
[Description("Revise a project's top-level fields. Only the fields you supply change; "
[McpServerTool(Name = "update_novel_brief")]
[Description("Revise a novel's top-level fields. Only the fields you supply change; "
+ "pass an empty string to clear one.")]
public static Task<CallToolResult> UpdateProject(
public static Task<CallToolResult> UpdateNovel(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct,
[Description("New title.")] string? title = null,
[Description("Author name.")] string? author = null,
@@ -49,6 +49,6 @@ public static class ProjectTools
[Description("Paragraph-length summary of the whole book.")] string? synopsis = null,
[Description("Free-form notes on theme, tone, comparable titles.")] string? notes = null,
[Description("Target manuscript length in words.")] int? targetWordCount = null) =>
api.PatchAsync($"/api/projects/{projectId}",
api.PatchAsync($"/api/novels/{novelId}",
new { title, author, genre, logline, synopsis, notes, targetWordCount }, ct);
}
+4 -4
View File
@@ -13,7 +13,7 @@ public static class QuestionTools
+ "thinking, not a gap to fill in for them.")]
public static Task<CallToolResult> ListOpenQuestions(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct,
[Description("Narrow to questions about one chapter outline.")] Guid? chapterId = null,
[Description("Narrow to questions about one character.")] Guid? characterId = null,
@@ -31,7 +31,7 @@ public static class QuestionTools
query.Add($"characterId={character}");
}
return api.GetAsync($"/api/projects/{projectId}/questions?{string.Join('&', query)}", ct);
return api.GetAsync($"/api/novels/{novelId}/questions?{string.Join('&', query)}", ct);
}
[McpServerTool(Name = "raise_open_question")]
@@ -39,13 +39,13 @@ public static class QuestionTools
+ "and/or the character it is about. Prefer raising a question over guessing.")]
public static Task<CallToolResult> RaiseOpenQuestion(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
[Description("The question, in one line.")] string question,
CancellationToken ct,
[Description("The thinking around it — options considered, and what each costs.")] string? detail = null,
[Description("Id of the chapter outline this is about, if any.")] Guid? chapterId = null,
[Description("Id of the character this is about, if any.")] Guid? characterId = null) =>
api.PostAsync($"/api/projects/{projectId}/questions",
api.PostAsync($"/api/novels/{novelId}/questions",
new { question, detail, chapterId, characterId }, ct);
[McpServerTool(Name = "update_open_question")]
+6 -6
View File
@@ -8,13 +8,13 @@ namespace Novelly.Mcp.Tools;
public static class TagTools
{
[McpServerTool(Name = "list_tags")]
[Description("List a project's tags with how many characters, chapters and beats carry each. "
[Description("List a novel's tags with how many characters, chapters and beats carry each. "
+ "Read this before inventing a new tag so you reuse the writer's vocabulary.")]
public static Task<CallToolResult> ListTags(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The novel's id.")] Guid novelId,
CancellationToken ct) =>
api.GetAsync($"/api/projects/{projectId}/tags", ct);
api.GetAsync($"/api/novels/{novelId}/tags", ct);
[McpServerTool(Name = "get_tag_references")]
[Description("Cross-reference a tag: every character, chapter and beat carrying it. Use this "
@@ -30,11 +30,11 @@ public static class TagTools
+ "chapter or beat also creates it, so this is only needed to set a colour up front.")]
public static Task<CallToolResult> CreateTag(
NovelApiClient api,
[Description("The project's id.")] Guid projectId,
[Description("The tag's name. Unique within the project, matched case-insensitively.")] string name,
[Description("The novel's id.")] Guid novelId,
[Description("The tag's name. Unique within the novel, matched case-insensitively.")] string name,
CancellationToken ct,
[Description("Optional hex colour for the UI, e.g. \"#9a4a2f\".")] string? color = null) =>
api.PostAsync($"/api/projects/{projectId}/tags", new { name, color }, ct);
api.PostAsync($"/api/novels/{novelId}/tags", new { name, color }, ct);
[McpServerTool(Name = "update_tag")]
[Description("Rename or recolour a tag. Renaming updates it everywhere it is applied.")]