Task Flow Manager

A CLI tool designed to help coding agents systematically manage and complete tasks with a single work-in-progress (WIP=1) constraint.

Features

  • WIP=1 Constraint: Enforces single-task focus - only one task can be in progress at a time
  • Template System: Initialize projects with predefined workflows (basic, feature development, bug fix, refactoring)
  • Validation Support: Automatic validation commands before task completion
  • Progress Tracking: Visual progress indicators and detailed status reporting
  • Multiple Output Formats: Human-readable, JSON, and table formats

Installation

go install github.com/nacyot/taskflow/cmd/task@latest

Or build from source:

git clone https://github.com/nacyot/taskflow.git
cd taskflow
go build -o task ./cmd/task

Quick Start

# Initialize a new project with the default template
task init "My Project"

# Check current status
task status

# Start working on a task
task start aaaa

# Complete a task
task done aaaa

# Continue with the next task
task start baaa

Templates

Task Flow Manager comes with several built-in templates:

  • basic_task - Simple 5-step workflow for general tasks
  • feature_dev - 7-step workflow for feature development
  • bug_fix - 6-step workflow for bug fixing
  • refactor - 7-step workflow for code refactoring

Example using a specific template:

task init -t feature_dev "User Authentication"

Commands

task init [options] <name>

Initialize a new TaskBundle with a template.

Options:

  • -t, --template <name> - Template name (default: basic_task)
  • --json - Output in JSON format

task status [options]

Show current task status and progress.

Options:

  • --json - Output in JSON format
  • --table - Output in table format

task start <task-id>

Start working on a task (enforces WIP=1).

task done <task-id> [options]

Complete a task, running validation if configured.

Options:

  • --skip-validation - Skip validation command
  • --json - Output in JSON format

task complete

Complete and finalize the TaskBundle when all tasks are done.

task complete                        # Complete bundle if all tasks are done

Validation

Tasks can include validation commands that run before completion:

tasks:
  - description: "Run tests"
    validation: "go test ./..."

If validation fails, the task remains in progress. Use --skip-validation to bypass.

Project Structure

When you run task init, it creates a .taskflow directory with:

.taskflow/
├── tasks.db          # SQLite database with all task data
└── templates/        # Custom templates (optional)

Creating Custom Templates

Create a YAML file in templates/ directory:

---
name: my_template
version: 1.0.0
description: Custom workflow template
tasks:
  - description: "First task"
    hint: "Optional hint text"
  - description: "{{MAIN_TASK}}"  # Variable substitution
    validation: "npm test"
---

Development

# Run tests
go test ./...

# Build
go build -o task ./cmd/task

# Run with verbose output
TASK_DEBUG=1 task status

Architecture

Task Flow Manager uses:

  • SQLite for local data storage
  • Cobra for CLI framework
  • Clean Architecture with domain/app/storage layers
  • WIP=1 constraint enforced at database level with unique index

License

MIT