AAnvio
Workflows & Automation

Goals

Persistent, long-horizon outcomes tracked as one YAML file per goal under workspace/goals/, independent of any conversation.

2 min read

Goals represent long-horizon outcomes with lifecycle management, progress tracking, and prioritization. They exist independently from conversations — a goal survives session restarts, provider changes, and workspace relocation because it is just a file.

The engine lives in packages/goals/src/index.ts as FilesystemGoalStore and GoalEngineImpl, wired together by createGoalEngine(storage).

Principles

  • File-first. One YAML file per goal under workspace/goals/.
  • No database required. Goals work at Level 1 on the filesystem alone.
  • Linkable. A goal can reference kanban tasks, automations, and assigned agents.

File layout

workspace/goals/
  project-refactor.yaml
  learn-golang.yaml
  _index.yaml            # optional explicit ordering

Schema

apiVersion: anvio.io/v1
kind: Goal
metadata:
  slug: project-refactor
  createdAt: '2026-06-01T00:00:00Z'
  updatedAt: '2026-06-19T08:00:00Z'
spec:
  title: Finish software project refactor
  description: Migrate monolith modules to packages with tests
  status: active # active | paused | completed | archived
  priority: high # critical | high | medium | low
  progress:
    percent: 35
    milestones:
      - name: Extract core package
        completed: true
        completedAt: '2026-06-10'
      - name: Migrate agents package
        completed: false
  assignedAgents:
    - architect
  linkedTasks:
    - kanban/task-001
  dueDate: '2026-08-31'

Lifecycle

GoalEngineImpl exposes create, updateProgress, complete, pause, resume, and prioritize. complete() sets status: completed and forces progress.percent to 100.

Rendering diagram…

Prioritization

FilesystemGoalStore.sortGoals() orders goals by, in order:

  1. Explicit priority (critical > high > medium > low).
  2. dueDate ascending (when both goals set one).
  3. Position in workspace/goals/_index.yaml (kind: GoalIndex).
  4. metadata.updatedAt descending.

The _index.yaml order is maintained automatically — create() appends new slugs, delete() removes them, and prioritize(slugs) rewrites the full order.

Integration points

SystemIntegration
KanbanTasks link via linkedTasks; tasks link back via linkedGoal.
AutomationAutomations can target a goal slug.
SoulsA soul's long-term goals may sync with goal files.

Recover a deleted goal

Goal files are plain YAML in your workspace. If you delete one by mistake and the workspace is under git, restore it from history — there is no separate trash or soft-delete.

TODO: The CLI verbs in docs/26-goal-system.md (anvio goal create, anvio goal progress, etc.) and the GOAL_* event subjects describe the intended surface. Verify each against the current apps/cli/src command table before treating them as stable — the engine API in packages/goals/src/index.ts is the authoritative contract.

Edit on GitHub

Last updated on

On this page