# All project options for this board live in this file instead of the index front matter.
# Kanbn looks for `kanbn.json` or `kanbn.yml` in the root of the workspace.
#
# Note: Kanbn rewrites this file whenever it saves project options (for example
# `kanbn sort --save`), which strips these comments.

startedColumns:
  - 'In Progress'
  - Review
completedColumns:
  - Done

# The Blocked column is hidden from the default board, but still tracked.
# Any view that defines its own columns can still show it.
hiddenColumns:
  - Blocked

defaultTaskWorkload: 2
taskWorkloadTags:
  Tiny: 1
  Small: 2
  Medium: 3
  Large: 5
  Huge: 8

# Extra metadata fields. Once declared here they can be set with `kanbn add`
# and `kanbn edit`, searched with `kanbn find`, sorted with `kanbn sort`,
# filtered in views, and interpolated into taskTemplate.
customFields:
  - name: team
    type: string
  - name: storyPoints
    type: number
  - name: needsDesign
    type: boolean
  - name: reviewedAt
    type: date
    updateDate: once

# `reviewedAt` is stamped the first time a task enters the Review column
# (`updateDate: once`). Use `always` to re-stamp on every move.
reviewedAtColumns:
  - Review

# The Backlog column is kept sorted in the index file itself, so the order
# survives `kanbn add`, `kanbn move` and `kanbn validate --save`.
columnSorting:
  Backlog:
    - field: workload
      order: descending
    - field: name
      order: ascending

dateFormat: yyyy-mm-dd

# The people who work on this workspace. A contributor can be a bare name or an
# object; `name` is the value written into a task's `assigned` field and a
# comment's `author`, and `aliases` catch the other spellings that mean the same
# person. The list is advisory - `assigned` stays free text and is never
# validated against it. Run `kanbn contributors --usage` to see which spellings
# are already in use. See docs/contributors.md.
contributors:
  - name: Ana
    email: ana@example.com
    aliases:
      - ana
      - Ana Ruiz
  - name: Ben
    email: ben@example.com
    aliases:
      - ben

# Rules that fire when a task changes. Actions only run during commands that
# change something - never during `board`, `find` or `burndown` - and nothing a
# rule writes can fire another rule. `--no-actions` on any of those commands, or
# KANBN_NO_ACTIONS=1, steps around a rule that is misbehaving.
# See docs/actions.md.
actions:
  # `task.started` is a transition rather than an operation: it fires when the
  # task wasn't started before and is now, whatever caused it. It reads
  # startedColumns above, so adding another started column doesn't break it.
  - name: start-work
    on: task.started
    then:
      - assign: '@me'
      - addTag: active
      - removeTag: ready

  - name: close-out
    on: task.completed
    then:
      - removeTag: active
      - setProgress: 1
      - set: { closedBy: '@me' }

  # `reviewedAt` above is stamped by the column linkage; the rule runs after it,
  # so it can see and override anything that stamping wrote.
  - name: flag-review
    on: task.moved
    when:
      toColumn: Review
    then:
      - addTag: needs-review
      - comment: 'Review requested by @me'

  # `for` points the verbs at related tasks instead of this one. Children carry
  # the `child-of` relation, so `incoming` finds them from the epic.
  - name: epic-blocks-children
    on: task.moved
    when:
      tag: epic
      toColumn: Blocked
    for:
      related: child-of
      direction: incoming
      where:
        is-completed: false
    then:
      - addTag: blocked-by-epic

# Custom fields (team, storyPoints, ...) can be interpolated here because they
# are declared in customFields above. See docs/index-structure.md for the full
# list of available variables.
taskTemplate: "^+^_${overdue ? '^R' : ''}${name}^:${assigned ? ('\\n^-@' + assigned) : ''}${team ? ('\\n^-' + team) : ''}${storyPoints ? ('\\n^-' + storyPoints + 'pts') : ''}${due ? ('\\n^-due ' + due) : ''}"
