WORK-031
ID:WORK-031Status:done

plan next Command

Priority:highComplexity:moderateSource:SPEC-022

Criteria completion

Criteria completion: 10 of 10 (100%) checked; history from Mar 22 to Mar 230%25%50%75%100%Mar 22Mar 23
Branches 3
History 4
  1. e900a90
    Created (done)by bjornolofandersson
  2. f262d7b
    Content editedby Claude
  3. 1d42882
    • ☑ Scans for work items with `status="ready"` and bugs with `status="confirmed"`
    • ☑ Excludes items whose dependency IDs (from References/Dependencies section) are not yet `done` or `fixed`
    • ☑ Sorts by priority (critical > high > medium > low), then complexity (simpler items first as tiebreaker)
    • ☑ `--milestone <name>` scopes results to a specific milestone
    • ☑ `--tag <tag>`, `--assignee <name>`, `--type work|bug|all` filters work correctly
    • ☑ `--count N` returns top N items (default: 1)
    • ☑ `--format json` outputs structured data including criteria list, referenced specs, dependencies, and file path
    • ☑ Text output shows ID, title, priority, complexity, file path, and acceptance criteria
    • ☑ Exit codes: 0 = items found, 1 = no matches, 2 = invalid arguments
    • ☑ Tests for filtering, sorting, dependency exclusion, and edge cases
    by Claude
  4. 30b2ae0
    Created (ready)by Claude
    Add 9 work items for SPEC-022 (Plan CLI) implementation

Summary

Dependency-aware work item selection. Finds the highest-priority ready item, skipping items whose dependencies aren't complete. This is the entry point of the AI agent workflow — refrakt plan next --format json tells the agent what to work on.

Acceptance Criteria

  • Scans for work items with status="ready" and bugs with status="confirmed"
  • Excludes items whose dependency IDs (from References/Dependencies section) are not yet done or fixed
  • Sorts by priority (critical > high > medium > low), then complexity (simpler items first as tiebreaker)
  • --milestone <name> scopes results to a specific milestone
  • --tag <tag>, --assignee <name>, --type work|bug|all filters work correctly
  • --count N returns top N items (default: 1)
  • --format json outputs structured data including criteria list, referenced specs, dependencies, and file path
  • Text output shows ID, title, priority, complexity, file path, and acceptance criteria
  • Exit codes: 0 = items found, 1 = no matches, 2 = invalid arguments
  • Tests for filtering, sorting, dependency exclusion, and edge cases

Approach

Use the scanner (WORK-028) to get all entities. Build a status lookup map (ID → status). Filter work/bug items by ready status, then exclude those with unfinished dependencies. Sort and slice. For JSON output, include the full criteria list and spec references.

Dependencies

  • WORK-027 (plugin architecture)
  • WORK-028 (plan file scanner)

References

  • SPEC-022 (Plan CLI)