From b4f35231d4bd37aa5d8861a9e2a5dbb2c842e723 Mon Sep 17 00:00:00 2001 From: typebasedio Date: Wed, 22 Apr 2026 17:55:29 -0400 Subject: [PATCH] docs(v0.4.1): add nested git guidance for project mode Project CLAUDE.md template now includes a Git section stating that the workspace uses a single git repo at the root and subdirectory git init is not permitted. docs/commands.md picks up the same guidance under the --project flag section. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/commands.md | 6 ++++++ internal/seed/templates.go | 6 ++++++ internal/seed/templates_test.go | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/docs/commands.md b/docs/commands.md index 1a690a7..bd53135 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -54,6 +54,12 @@ When `--no-launch` is used, no session is started and no session log is written. - `CTASK_PROJECT_ROOT` set, no `-c`: workspace goes directly under `$CTASK_PROJECT_ROOT/_` (no `projects/` subdirectory is appended) - `CTASK_PROJECT_ROOT` set, explicit `-c `: workspace goes under `$CTASK_PROJECT_ROOT//_` +**Single git repo rule:** + +Project workspaces use a single git repository initialized at the workspace root. +Do not create nested git repositories inside the workspace. If your project code +lives in a subdirectory, it is tracked by the root repo. + ### Seed directories On `ctask new`, after writing the built-in defaults, ctask copies the contents of an optional user seed directory into the workspace. Files in the seed directory overwrite the built-in defaults; subdirectories are preserved recursively. `task.yaml` and `.ctask/` at the seed root are always skipped. diff --git a/internal/seed/templates.go b/internal/seed/templates.go index 2fe5196..7e61437 100644 --- a/internal/seed/templates.go +++ b/internal/seed/templates.go @@ -62,6 +62,12 @@ This is a ctask project workspace -- a long-lived working environment, not a dis - Record important assumptions and actions in notes.md. - Keep the workspace root clean. +## Git + +This workspace uses a single git repository at the workspace root. +Do not initialize additional git repositories inside subdirectories. +All project code, even if nested in a subdirectory, is tracked by the root repo. + ## 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 7a2f18c..73b9048 100644 --- a/internal/seed/templates_test.go +++ b/internal/seed/templates_test.go @@ -62,6 +62,18 @@ func TestClaudeMDProjectContainsRequiredSections(t *testing.T) { } } +func TestClaudeMDProjectContainsNestedGitRule(t *testing.T) { + body := ClaudeMDProject() + for _, must := range []string{ + "single git repository", + "Do not initialize additional git repositories", + } { + if !strings.Contains(body, must) { + t.Errorf("ClaudeMDProject missing guidance %q", must) + } + } +} + func TestNotesMDIsASCII(t *testing.T) { content := NotesMD("test title") for i, b := range []byte(content) {