Skip to content

feat: optional JSON metadata on tasks, projects, and initiatives#27

Merged
danielkov merged 1 commit intomainfrom
feat/metadata
Mar 11, 2026
Merged

feat: optional JSON metadata on tasks, projects, and initiatives#27
danielkov merged 1 commit intomainfrom
feat/metadata

Conversation

@danielkov
Copy link
Copy Markdown
Collaborator

Entity metadata

Tasks, projects, and initiatives now support an optional free-form JSON metadata field. This lets you attach arbitrary structured information — environment config, tracking IDs, custom fields — to any entity without being limited to text-only tags.

CLI usage:

granary project my-proj tasks create "deploy service" \
  --metadata '{"env": "production", "region": "us-east-1"}'

granary tasks update proj-task-1 \
  --metadata '{"env": "staging", "retries": 3}'

Metadata works the same way on projects (project create/update --metadata) and initiatives (initiative create/update --metadata).

Output behavior:

Metadata is included in --output json / --json output but is intentionally excluded from prompt and text formats, keeping those outputs clean for human and LLM consumption.

Event template access:

Metadata is embedded as a nested JSON object in all event payloads (task.created, task.updated, task.next, project.created, etc.), so event templates can reference individual metadata fields:

{metadata.env}
{metadata.region}
{metadata.config.timeout}

This enables metadata-driven automation — for example, a task.next handler that routes work based on {metadata.env} or {metadata.worktree}.

✻ Clauded...

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danielkov danielkov merged commit 70f7d46 into main Mar 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant