feat: workspace creation with seed files and collision handling

Create function produces full workspace layout (task.yaml, CLAUDE.md, notes.md, context/, output/, logs/). Seed files only written if missing. Collision suffixing tested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 18:30:59 -04:00
parent 7b75cb5f3d
commit 17789e4b9f
3 changed files with 305 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
package seed
import "fmt"
// ClaudeMD returns the advisory CLAUDE.md content for a workspace.
func ClaudeMD(slug, category, workspacePath string) string {
return fmt.Sprintf(`# Task Workspace: %s
This is a ctask-managed workspace.
- **Category:** %s
- **Workspace:** %s
## Scope
This workspace is scoped to a single task. Keep work focused on the task described in notes.md.
## Files
- task.yaml — Task metadata (machine-managed, do not edit)
- notes.md — Task log (human/agent-managed)
- context/ — Reference documents (user-managed)
- output/ — Task deliverables and artifacts
- logs/ — Session logs (reserved for future use)
`, slug, category, workspacePath)
}
// NotesMD returns the skeleton notes.md content.
func NotesMD(title string) string {
return fmt.Sprintf(`# %s
## Purpose
## Constraints
## Actions
## Results
`, title)
}