grokkit/internal/todo/todo.go
Greg Gauthier d6f507b8cb feat(workon): enhance command to start or complete todos/fixes with git integration
- Update workonCmd to accept todo_item_title arg and add -f/--fix, -c/--complete flags
- Implement transactional flow: bootstrap todo dirs, move/create .md files, create branch, append Grok-generated Work Plan, commit
- Add todo package with Bootstrap for directory structure
- Expand workon.Run to handle modes (todo, fix, complete) with placeholders for Grok integration and optional cnadd/IDE open
2026-03-31 20:42:32 +01:00

29 lines
642 B
Go

package todo
import (
"os"
"path/filepath"
)
const todoRoot = "todo"
// Bootstrap creates the todo folder structure + basic index if missing.
func Bootstrap() error {
dirs := []string{
filepath.Join(todoRoot, "queued"),
filepath.Join(todoRoot, "doing"),
filepath.Join(todoRoot, "completed"),
}
for _, d := range dirs {
if err := os.MkdirAll(d, 0755); err != nil {
return err
}
}
// Basic index README stub
index := filepath.Join(todoRoot, "README.md")
if _, err := os.Stat(index); os.IsNotExist(err) {
return os.WriteFile(index, []byte("# Todo Index\n\n## Queued\n## Doing\n## Completed\n"), 0644)
}
return nil
}