Dex

From markerikson/opencode-config-example · View interactive version

Dex is an AI agent skill from the GitHub repository markerikson/opencode-config-example. Manage tasks via dex CLI. Use when breaking down complex work, tracking implementation items, or persisting context across sessions.

How to use this skill

Skill file

Agent Coordination with dex

Version: 0.16+ (this doc assumes 0.16 features)

Command Invocation

Use dex directly for all commands. If not on PATH, use npx @zeeg/dex instead.

command -v dex &>/dev/null && echo "use: dex" || echo "use: npx @zeeg/dex"

Core Principle: Tickets, Not Todos

Dex tasks are tickets - structured artifacts with comprehensive context:

Think: "Would someone understand the what, why, and how from this task alone?"

Dex Tasks are Ephemeral

Never reference dex task IDs in external artifacts (commits, PRs, docs). Task IDs like abc123 become meaningless once tasks are completed. Describe the work itself, not the task that tracked it.

When to Use dex

Use dex when:

Skip dex when:

dex vs Built-in Task Tools

Some AI agents (like Claude Code) have built-in task tools. These are session-only and not the same as dex.

| | dex | Built-in Task Tools |

| --------------- | ------------------------------------- | ------------------- |

| Persistence | Files in .dex/ | Session-only |

| Context | Rich (description + context + result) | Basic |

| Hierarchy | 3-level (epic → task → subtask) | Flat |

Use dex for persistent work. Use built-in task tools for ephemeral in-session tracking only.

Basic Workflow

Start Working on a Task

dex list                  # See pending tasks
dex start <id>            # Mark task as in progress
dex show <id>             # Full details
dex list --in-progress    # Show in-progress tasks

Create a Task

dex create "Short name" --description "Full implementation context"

Description should include: what needs to be done, why, implementation approach, and acceptance criteria. See examples.md for good/bad examples.

List and View Tasks

dex list                  # Pending tasks
dex list --ready          # Unblocked tasks
dex show <id>             # Full details

Complete a Task

dex complete <id> --result "What was accomplished" --commit <sha>
dex complete <id> --result "Planning only" --no-commit    # No code changes
dex complete <id> --result "..." --force                  # Bypass subtask check

Important: For tasks linked to GitHub/Shortcut, you must specify either --commit <sha> or --no-commit. The commit SHA is validated locally.

Always verify before completing. Results must include evidence: test counts, build status, manual testing outcomes. See verification.md for the full checklist.

Edit and Delete

dex edit <id> --description "Updated description"
dex edit <id> --commit <sha>    # Link commit to already-completed task
dex delete <id>

Archive Completed Tasks

Reduce storage by archiving old completed tasks:

dex archive <id>                # Archive specific task
dex archive --older-than 60d    # Archive tasks completed >60 days ago
dex archive --completed         # Archive ALL completed tasks
dex list --archived             # View archived tasks

For full CLI reference including sync/import, see cli-reference.md.

Understanding Task Fields

Tasks have two text fields:

When you run dex show <id>, the description may be truncated. The CLI will hint at --full if there's more content. Use --expand to see ancestor descriptions in tree view.

Gathering Context

When picking up a task, gather all relevant context:

dex show <id> --full              # Full task details
dex show <parent-id> --full       # Parent context (if applicable)
dex show <blocker-id> --full      # What blockers accomplished

Before starting, verify you can answer:

If any answer is unclear:

  1. Check parent task or completed blockers for more details
  2. Suggest entering plan mode to flesh out requirements before starting

Proceed without full context when:

Task Hierarchies

Three levels: Epic (large initiative) → Task (significant work) → Subtask (atomic step).

Choosing the right level:

# Create subtask under parent
dex create --parent <id> "Subtask name" --description "..."

For detailed hierarchy guidance, see hierarchies.md.

Recording Results

Complete tasks immediately after implementing AND verifying:

Your result must include explicit verification evidence. Don't just describe what you did—prove it works. See verification.md.

Commit Messages with GitHub/Shortcut

When a task is linked to a GitHub issue or Shortcut story (shown in dex show output), include references in commit messages:

Check dex show <id> for issue info before committing. The "(via parent)" indicator means use Refs, direct metadata means use Fixes.

Sync Behavior

Best Practices

  1. Right-size tasks: Completable in one focused session
  2. Clear completion criteria: Description should define "done"
  3. Don't over-decompose: 3-7 children per parent
  4. Action-oriented descriptions: Start with verbs ("Add", "Fix", "Update")
  5. Verify before completing: Tests passing, manual testing done

Additional Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.