diff --git a/internal/seed/templates.go b/internal/seed/templates.go index a65e1ed..195792c 100644 --- a/internal/seed/templates.go +++ b/internal/seed/templates.go @@ -26,6 +26,22 @@ This is a ctask workspace. Prefer operating inside this directory unless explici - Record important assumptions and actions in notes.md - Keep the workspace root clean -- use subdirectories for organization +## Cross-Workspace Context + +Related work may exist in other ctask workspaces. For project continuation, +migration, debugging, or building on prior work, inspect related workspaces +before making changes. + +Available commands: + + ctask list --all discover all workspaces, including archived + ctask info view metadata and status of any workspace + ctask notes read another workspace's notes.md + ctask path get the filesystem path to inspect files directly + +Treat other workspaces as read-only unless the user explicitly asks you to +modify them. + ## Session Handoff Before ending a session, append a brief summary to notes.md with: @@ -84,6 +100,22 @@ Do not initialize additional git repositories inside the project subdirectory or any other subdirectory. If you need to check git status or make commits, the repo root is the workspace root. +## Cross-Workspace Context + +Related work may exist in other ctask workspaces. For project continuation, +migration, debugging, or building on prior work, inspect related workspaces +before making changes. + +Available commands: + + ctask list --all discover all workspaces, including archived + ctask info view metadata and status of any workspace + ctask notes read another workspace's notes.md + ctask path get the filesystem path to inspect files directly + +Treat other workspaces as read-only unless the user explicitly asks you to +modify them. + ## Session Handoff Before ending a session, append a brief summary to notes.md with: diff --git a/internal/seed/templates_test.go b/internal/seed/templates_test.go index 50c04af..9f3bcf2 100644 --- a/internal/seed/templates_test.go +++ b/internal/seed/templates_test.go @@ -89,6 +89,40 @@ func TestClaudeMDProjectDescribesWorkspaceStructure(t *testing.T) { } } +func TestClaudeMDContainsCrossWorkspaceSection(t *testing.T) { + // v0.5.2: both templates teach agents to use ctask's read-only context + // commands before starting work. + content := ClaudeMD("ignored", "ignored", "ignored") + for _, must := range []string{ + "## Cross-Workspace Context", + "ctask list --all", + "ctask info ", + "ctask notes ", + "ctask path ", + "Treat other workspaces as read-only", + } { + if !strings.Contains(content, must) { + t.Errorf("task CLAUDE.md missing cross-workspace marker %q", must) + } + } +} + +func TestClaudeMDProjectContainsCrossWorkspaceSection(t *testing.T) { + content := ClaudeMDProject() + for _, must := range []string{ + "## Cross-Workspace Context", + "ctask list --all", + "ctask info ", + "ctask notes ", + "ctask path ", + "Treat other workspaces as read-only", + } { + if !strings.Contains(content, must) { + t.Errorf("project CLAUDE.md missing cross-workspace marker %q", must) + } + } +} + func TestNotesMDIsASCII(t *testing.T) { content := NotesMD("test title") for i, b := range []byte(content) {